Age | Commit message (Collapse) | Author | Files | Lines |
|
Remove the call to platform_get_irq use the cached
one instead.
Signed-off-by: Shubhrajyoti Datta <[email protected]>
Reviewed-by: Michal Simek <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The new helper returns index of the matching string in an array.
We are going to use it here.
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The pcal6524 has another set of registers to fine control
the interrupt handling.
Signed-off-by: H. Nikolaus Schaller <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
PCAL chips ("L" seems to stand for "latched") have additional
registers starting at address 0x40 to control the latches,
interrupt mask, pull-up and pull down etc.
Signed-off-by: H. Nikolaus Schaller <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
which makes it easier to match them with the data sheets.
Signed-off-by: H. Nikolaus Schaller <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Casting a pointer to u16 can produce a compiler warning such as this:
drivers/gpio/gpio-ge.c: In function 'gef_gpio_probe':
drivers/gpio/gpio-ge.c:83:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
gc->ngpio = (u16)of_device_get_match_data(&pdev->dev);
^
Cast the pointer through a uintptr_t to avoid the warning.
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
There is a shifter vs vanilla mask bug here. We want to test if 1 << 11
is set but we're testing if 0xb is set.
Fixes: 9a6c505f7df1 ("gpiolib: add hogs support for machine code")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use the SPDX license identifier for GPLv2.0 or later and remove the
license boilerplate.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The DesignWare GPIO IP can be configured for either 1 interrupt or 1
per GPIO in port A, but the driver currently only supports 1 interrupt.
See the DesignWare DW_apb_gpio Databook description of the
'GPIO_INTR_IO' parameter.
This change allows the driver to work with up to 32 interrupts, it will
get as many interrupts as specified in the DT 'interrupts' property.
It doesn't do anything clever with the different interrupts, it just calls
the same handler used for single interrupt hardware.
ACPI companion code provided by Hoan Tran <[email protected]>. This was tested
on X-Gene by Hoan.
Signed-off-by: Phil Edworthy <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Acked-by: Lee Jones <[email protected]>
Acked-by: Hoan Tran <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Don't populate the const read-only arrays 'port' on the stack but
instead make them static. Makes the object code smaller:
Before:
text data bss dec hex filename
8542 4088 672 13302 33f6 drivers/gpio/gpio-gpio-mm.o
10959 4952 832 16743 4167 drivers/gpio/gpio-104-dio-48e.o
9022 5064 1408 15494 3c86 drivers/gpio/gpio-104-idi-48.o
After:
text data bss dec hex filename
8372 4144 672 13188 3384 drivers/gpio/gpio-gpio-mm.o
10790 5008 832 16630 40f6 drivers/gpio/gpio-104-dio-48e.o
8853 5152 1408 15413 3c35 linux/drivers/gpio/gpio-104-idi-48.o
(gcc version 7.2.0 x86_64)
Signed-off-by: Colin Ian King <[email protected]>
Acked-by: William Breathitt Gray <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so we should only include <linux/gpio/driver.h>.
However this driver was using gpio_get_value() to fetch the
current value of a GPIO used as IRQ line to determine trigger
direction, so we need a better way than looping over the
global GPIO numberspace.
Fix this by just calling the .get() function in the GPIO chip,
as we don't want to end up creating a consumer dependency
on ourselves.
Cc: Vladimir Zapolskiy <[email protected]>
Cc: Fabio Estevam <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The MVEBU driver is requesting GPIO descriptors from itself, which
is fine, but we have proper APIs to do this in a controlled way, so
stop calling into the private functions of the GPIO library and use
the gpiochip_* functions instead. Only include <linux/gpio/driver.h>
and <linux/gpio/consumer.h> since we are both producers and consumers
in this case.
Cc: Gregory CLEMENT <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Jason Cooper <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so only include <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so include only <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so include only <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so only include <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so only include <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so only include <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so only include <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so only include <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so include only <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a driver so only include <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
This switches the Loongson driver over to using the bitops BIT()
macros and drops some local variables and make the code easier
to read (in my opinion).
Cc: Keguang Zhang <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Walleij <[email protected]>
|
|
It is pretty helpful to create some kind of device for backing the
GPIO chips, especially when preparing the driver for using
GENERIC_GPIO, so let's create a simple platform device and a simple
platform device driver and create the gpiochip in the .probe() routine
for the device driver. Keep all at the core initcall so the behaviour
is the same as before.
Cc: Keguang Zhang <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Walleij <[email protected]>
|
|
The driver includes <linux/gpio.h> which is wrong, rely on
<linux/gpio/driver.h> and remove to call to gpio_set_value() in
favor of calling the internal function. Move functions around to
avoid forward declarations.
Cc: Keguang Zhang <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Walleij <[email protected]>
|
|
Board files constitute a significant part of the users of the legacy
GPIO framework. In many cases they only export a line and set its
desired value. We could use GPIO hogs for that like we do for DT and
ACPI but there's no support for that in machine code.
This patch proposes to extend the machine.h API with support for
registering hog tables in board files.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Don't populate the const read-only array 'ports' on the stack but instead
make it static. Makes the object code smaller by over 100 buytes:
Before:
text data bss dec hex filename
10959 4952 832 16743 4167 drivers/gpio/gpio-104-dio-48e.o
After:
text data bss dec hex filename
10790 5008 832 16630 40f6 drivers/gpio/gpio-104-dio-48e.o
(gcc version 7.2.0 x86_64)
Signed-off-by: Colin Ian King <[email protected]>
Acked-by: William Breathitt Gray <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This patch will toggle the EIC level to emulate the edge trigger to
support PMIC EIC egdge trigger function, which is required by gpio-keys
driver.
Signed-off-by: Baolin Wang <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The Spreadtrum debounce EIC and latch EIC can not support edge trigger,
but most GPIO users (like gpio-key driver) only use the edge trigger,
thus the EIC driver need add some support to emulate the edge trigger
to satisfy this requirement.
Signed-off-by: Baolin Wang <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The PCIe-IDIO-24 features 8 bits of TTL GPIO which may be configured for
output or input. This patch fixes an off-by-one error in the loop
conditional for the get_multiple callback so that the TTL GPIO are
handled.
Fixes: ca37081595a2 ("gpio: pcie-idio-24: Implement get_multiple/set_multiple callbacks")
Signed-off-by: William Breathitt Gray <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Geert Uytterhoeven pointed out that the number of register was a
fixed upper bound so there's no need to use a dynamically allocated
array in place of a VLA. Use the defined upper bound.
Suggested-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Laura Abbott <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
callbacks
The ioread8/iowrite8 functions expect a memory offset argument. This
patch fixes the ports array to provide the memory addresses of the
respective device I/O registers.
Fixes: ca37081595a2 ("gpio: pcie-idio-24: Implement get_multiple/set_multiple callbacks")
Signed-off-by: William Breathitt Gray <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The ioread8 function expects a memory offset argument. This patch fixes
the ports array to provide the memory addresses of the respective device
I/O registers.
Fixes: 810ebfc5efca ("gpio: pci-idio-16: Implement get_multiple callback")
Signed-off-by: William Breathitt Gray <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
If gpiod_request() fails the cleanup must not call gpiod_free().
Cc: [email protected]
Fixes: 61f922db7221 ("gpio: userspace ABI for reading GPIO line events")
Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
If the main loop in linehandle_create() encounters an error, it
unwinds completely by freeing all previously requested GPIO
descriptors. However, if the error occurs in the beginning of
the loop before that GPIO is requested, then the exit code
attempts to free a null descriptor. If extrachecks is enabled,
gpiod_free() triggers a WARN_ON.
Instead, keep a separate count of legitimate GPIOs so that only
those are freed.
Cc: [email protected]
Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines")
Reviewed-by: Bjorn Andersson <[email protected]>
Signed-off-by: Timur Tabi <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The unmask function disables all interrupts in a bank when unmasking an
interrupt. Only disable the given interrupt.
Cc: [email protected]
Signed-off-by: Govert Overgaauw <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree updates from Rob Herring:
- Sync dtc to upstream version v1.4.6-9-gaadd0b65c987. This adds a
bunch more warnings (hidden behind W=1).
- Build dtc lexer and parser files instead of using shipped versions.
- Rework overlay apply API to take an FDT as input and apply overlays
in a single step.
- Add a phandle lookup cache. This improves boot time by hundreds of
msec on systems with large DT.
- Add trivial mcp4017/18/19 potentiometers bindings.
- Remove VLA stack usage in DT code.
* tag 'devicetree-for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (26 commits)
of: unittest: fix an error code in of_unittest_apply_overlay()
of: unittest: move misplaced function declaration
of: unittest: Remove VLA stack usage
of: overlay: Fix forgotten reference to of_overlay_apply()
of: Documentation: Fix forgotten reference to of_overlay_apply()
of: unittest: local return value variable related cleanups
of: unittest: remove unneeded local return value variables
dt-bindings: trivial: add various mcp4017/18/19 potentiometers
of: unittest: fix an error test in of_unittest_overlay_8()
of: cache phandle nodes to reduce cost of of_find_node_by_phandle()
dt-bindings: rockchip-dw-mshc: use consistent clock names
MAINTAINERS: Add linux/of_*.h headers to appropriate subsystems
scripts: turn off some new dtc warnings by default
scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
scripts/dtc: generate lexer and parser during build instead of shipping
powerpc: boot: add strrchr function
of: overlay: do not include path in full_name of added nodes
of: unittest: clean up changeset test
arm64/efi: Make strrchr() available to the EFI namespace
ARM: boot: add strrchr function
...
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO updates from Linus Walleij:
"This is the bulk of GPIO changes for the v4.17 kernel cycle:
New drivers:
- Nintendo Wii GameCube GPIO, known as "Hollywood"
- Raspberry Pi mailbox service GPIO expander
- Spreadtrum main SC9860 SoC and IEC GPIO controllers.
Improvements:
- Implemented .get_multiple() callback for most of the
high-performance industrial GPIO cards for the ISA bus.
- ISA GPIO drivers now select the ISA_BUS_API instead of depending on
it. This is merged with the same pattern for all the ISA drivers
and some other Kconfig cleanups related to this.
Cleanup:
- Delete the TZ1090 GPIO drivers following the deletion of this SoC
from the ARM tree.
- Move the documentation over to driver-api to conform with the rest
of the kernel documentation build.
- Continue to make the GPIO drivers include only
<linux/gpio/driver.h> and not the too broad <linux/gpio.h> that we
want to get rid of.
- Managed to remove VLA allocation from two drivers pending more
fixes in this area for the next merge window.
- Misc janitorial fixes"
* tag 'gpio-v4.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (77 commits)
gpio: Add Spreadtrum PMIC EIC driver support
gpio: Add Spreadtrum EIC driver support
dt-bindings: gpio: Add Spreadtrum EIC controller documentation
gpio: ath79: Fix potential NULL dereference in ath79_gpio_probe()
pinctrl: qcom: Don't allow protected pins to be requested
gpiolib: Support 'gpio-reserved-ranges' property
gpiolib: Change bitmap allocation to kmalloc_array
gpiolib: Extract mask allocation into subroutine
dt-bindings: gpio: Add a gpio-reserved-ranges property
gpio: mockup: fix a potential crash when creating debugfs entries
gpio: pca953x: add compatibility for pcal6524 and pcal9555a
gpio: dwapb: Add support for a bus clock
gpio: Remove VLA from xra1403 driver
gpio: Remove VLA from MAX3191X driver
gpio: ws16c48: Implement get_multiple callback
gpio: gpio-mm: Implement get_multiple callback
gpio: 104-idi-48: Implement get_multiple callback
gpio: 104-dio-48e: Implement get_multiple callback
gpio: pcie-idio-24: Implement get_multiple/set_multiple callbacks
gpio: pci-idio-16: Implement get_multiple callback
...
|