Age | Commit message (Collapse) | Author | Files | Lines |
|
Because gpiochip_irqchip_add() may fail, its return value should
be checked.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Gregory Fong <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Cavium ThunderX and OCTEON-TX are arm64 based SoCs. Add driver for
the on-chip GPIO pins.
Signed-off-by: David Daney <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Shrink the driver by removing the code dealing with dummy interrupts
and replacing it with calls to the irq_sim API.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This driver is non-modular so explicitly disallow a driver unbind.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This driver is non-modular so explicitly disallow a driver unbind.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This driver is non-modular so explicitly disallow a driver unbind.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
HPLL is in fact not the clock we need. Remove the description of which clock we
failed to find a phandle to in order to avoid any further error.
Signed-off-by: Andrew Jeffery <[email protected]>
Acked-by: Joel Stanley <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
74HC595 has an /OE (output enable) pin that can be controlled by a GPIO.
Introduce an optional property called 'enable-gpios' that allows
controlling the /OE pin.
Signed-off-by: Fabio Estevam <[email protected]>
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Make the structure const as it is only passed to the function
devm_regmap_add_irq_chip having the corresponding argument as const.
Done using Coccinelle.
Signed-off-by: Bhumika Goyal <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Fix function parameters alignment reported by checkpatch.
Signed-off-by: Michal Simek <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This patch fixes the below warning
-->Block comments should align the * on each line.
-->suspect code indent for conditional statements.
-->Prefer 'unsigned int' to bare use of 'unsigned'
Signed-off-by: Nava kishore Manne <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Remove one additional line and add two new. All are reported by checkpatch.
Signed-off-by: Michal Simek <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This patch fixes the kernel doc warnings in the driver.
Signed-off-by: Nava kishore Manne <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This patch provides workaround in the gpio driver
for Zynq and ZynqMP Platforms by reading pin value
of EMIO banks through DATA register as it was unable
to read the value of it from DATA_RO register.
Signed-off-by: Swapna Manupati <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Add support for suspend resume. Now that we can lose context across
a suspend/ resume cycle. Add support for the context restore.
Signed-off-by: Shubhrajyoti Datta <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This patch adds support for TPS68470 GPIOs.
There are 7 GPIOs and a few sensor related GPIOs.
These GPIOs can be requested and configured as
appropriate.
The GPIOs are also provided with descriptive names.
However, the typical use case is that the OS GPIO
driver will interact with TPS68470 GPIO driver
to configure these GPIOs, as requested by the
platform firmware.
Signed-off-by: Rajmohan Mani <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Currently davinci_gpio_irq_setup return value is ignored. Handle the
return value appropriately.
Signed-off-by: Keerthy <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The Rapid General-Purpose Input and Output with 2 Ports (RGPIO2P)
on MX7ULP is similar to GPIO on Vibrid. But unlike Vibrid, the
RGPIO2P has an extra Port Data Direction Register (PDDR) used
to configure the individual port pins for input or output.
We introduce a bool have_paddr with fsl_gpio_soc_data data
to distinguish this differences. And we support getting the output
status by checking the GPIO direction in PDDR.
Cc: Alexandre Courbot <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Fugang Duan <[email protected]>
Cc: Peter Chen <[email protected]>
Signed-off-by: Dong Aisheng <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
platform_get_irq() returns an error code, but the gpio-msic driver
ignores it and always returns -EINVAL. This is not correct, and
prevents -EPROBE_DEFER from being propagated properly.
Notice that platform_get_irq() no longer returns 0 on error:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af
Print and propagate the return value of platform_get_irq on failure.
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
omap_gpio_probe() can fail here and we must disable clock.
Signed-off-by: Arvind Yadav <[email protected]>
Reviewed-by: Grygorii Strashko <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
From the datasheet, the GPIO interface is identical to IT8728 (same
description), so just add it to the same case as the other chip.
Signed-off-by: Diego Elio Pettenò <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Acked-by: Jon Hunter <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Acked-by: Jon Hunter <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Rather than manually compute the size of an array, pass the number and
element size to kcalloc().
Signed-off-by: Thierry Reding <[email protected]>
Acked-by: Jon Hunter <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
of_device_get_match_data() can never return NULL, therefore the check
for NULL values is unnecessary.
Signed-off-by: Thierry Reding <[email protected]>
Acked-by: Jon Hunter <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Fix up some references to parameters to match the code.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Fix up a parameter description to match the code and fix markup for a
constant to prettify output.
Signed-off-by: Thierry Reding <[email protected]>
Acked-by: Andy Shevchenko <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Add missing descriptions for some parameters to match the code.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Add descriptions for missing fields and fix up some parameter references
to match the code.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Some kerneldoc has become stale or wasn't quite correct from the outset.
Fix up the most serious issues to silence warnings when building the
documentation.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use platform_irq_count() instead of open-coding the same code sequence.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.
Signed-off-by: Rob Herring <[email protected]>
Cc: Tien Hock Loh <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: Brian Norris <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: [email protected]
Cc: Michal Simek <[email protected]>
Cc: "Sören Brinkmann" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Acked-by: Gregory Fong <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
In case of devm_clk_get failure use dev_err instead of printk
Signed-off-by: Keerthy <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use the devm version of gpiochip_add_data and pass on the
return value. This avoids memory leak due to gpiochip_add_data
in case the driver is unbound.
Signed-off-by: Keerthy <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This structure is only used to copy into another structure, so declare
it as const.
This issue was detected using Coccinelle and the following semantic patch:
@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 = { ... };
In the following log you can see a significant difference in the code size
and data segment, hence in the dec segment. This log is the output
of the size command, before and after the code change:
before:
text data bss dec hex filename
1954 600 0 2554 9fa drivers/gpio/gpio-altera-a10sr.o
after:
text data bss dec hex filename
1655 512 0 2167 877 drivers/gpio/gpio-altera-a10sr.o
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Reviewed-by: Thor Thayer <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Errors from enable_irq_wake() in gpio_set_wake_irq() were silently ignored.
Thus led to the problem that gpio_set_wake_irq() always returned
successfully, even if enable_irq_wake() returned an error.
Signed-off-by: Philipp Rosenberger <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Add fallback compatibility string for R-Car Gen 1, 2 and 3.
In the case of Renesas R-Car hardware we know that there are generations of
SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship
between IP blocks might be. For example, I believe that r8a7790 is older
than r8a7791 but that doesn't imply that the latter is a descendant of the
former or vice versa.
We can, however, by examining the documentation and behaviour of the
hardware at run-time observe that the current driver implementation appears
to be compatible with the IP blocks on SoCs within a given generation.
For the above reasons and convenience when enabling new SoCs a
per-generation fallback compatibility string scheme being adopted for
drivers for Renesas SoCs.
Also deprecate renesas,gpio-rcar as its name is more generic than its
implementation.
Signed-off-by: Simon Horman <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
In header files, static inline is more commonly used.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Now IRQ mappings are always created for all (allowed) GPIOs in gpiochip in
gpiochip_irqchip_add_key() which goes against the idea of SPARSE_IRQ and,
as result, leads to:
- increasing of memory consumption for IRQ descriptors most of which will
never ever be used (espessially on platform with a high number of GPIOs).
(sizeof(struct irq_desc) == 256 on my tested platforms)
- imposibility to use GPIO irqchip APIs by gpio drivers when HW implements
GPIO IRQ functionality as IRQ crossbar/router which has only limited
number of IRQ outputs (example from [1], all GPIOs can be mapped on only 8
IRQs).
Hence, remove static IRQ mapping code from gpiochip_irqchip_add_key() and
instead replace irq_find_mapping() with irq_create_mapping() in
gpiochip_to_irq(). Also add additional gpiochip_irqchip_irq_valid() calls
in gpiochip_to_irq() and gpiochip_irq_map().
After this change gpio2irq mapping will happen the following way when GPIO
irqchip APIs are used by gpio driver:
- IRQ mappings will be created statically if driver passes first_irq>0
vlaue in gpiochip_irqchip_add_key().
- IRQ mappings will be created dynamically from gpio_to_irq() or
of_irq_get().
Tested on am335x-evm and dra72-evm-revc.
- dra72-evm-revc: number of created irq mappings decreased from 402 -> 135
Mem savings 267*256 = 68352 (66kB)
- am335x-evm: number of created irq mappings decreased from 188 -> 63
Mem savings 125*256 = 32000 (31kB)
[1] https://lkml.org/lkml/2017/6/15/428
Signed-off-by: Grygorii Strashko <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Before querying a GPIO to determine its direction, the GPIO should be
formally requested. This allows the GPIO driver to block access to
unavailable GPIOs, which makes it easier for some drivers to support
sparse GPIO maps.
Signed-off-by: Timur Tabi <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
i2c_smbus commands handle the correct byte order for smbus transactions
internally. This will currently result in incorrect operation on big
endian systems.
Suggested-by: Sebastian Reichel <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|