mirror of
https://github.com/suyu-emu/horinux.git
synced 2026-09-21 14:15:21 -07:00
Merge tag 'gpio-v4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO updates from Linus Walleij:
"This is the bulk of the GPIO changes for the v4.14 cycle.
Not so much changes this time, phew. David Daney and Bartosz
Golaszewski did all the really interesting work in infrastructure
improvement across GPIO and IRQ core, hats off for them and to tglx
and Marc Z for general help with these patch sets.
Core changes:
- Allow the GPIO irqchip to allocate IRQs dynamically. This is an
important change on systems where only a restricted number of IRQs,
lesser than the number of GPIO lines, can be utilized. Now we can
allocate these on a first-come-first-served basis instead of
hogging up valuable IRQ lines.
- Serious fix-up of the kerneldoc documentation and inclusion into
the kerneldoc builds.
- Pulled in the IRQ simulator from the IRQ core tree and use this in
the GPIO mockup driver for exhaustive testing of interrupt
abilities.
New drivers:
- New driver for ThunderX and OCTEON-TX. This is especially
interesting as it picks up improvements from the IRQ core that
allow us to handle fasteoi ACKs upwards in a hierarchy when there
are IRQ flag latches on several levels in a hierarchy. Very
interesting work here.
- New subdriver for Renesas R-Car r8a7745 (RZ/G1E).
Misc:
- Several fixes and improvements for Xilinx Zynq GPIO.
- Support an enablement GPIO for the 74x164 GPIO.
- Switch a bunch of chips to use devres to allocate irq descriptors.
- A bunch of constification fixes"
* tag 'gpio-v4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (63 commits)
gpio: mockup: remove unused variable gc
gpio: pl061: constify amba_id
Revert "gpiolib: request the gpio before querying its direction"
gpio: twl6040: remove unneeded forward declaration
gpio: zevio: make gpio_chip const
gpio: add gpio_add_lookup_tables() to add several tables at once
gpio: rcar: Add r8a7745 (RZ/G1E) support
gpio: brcmstb: check return value of gpiochip_irqchip_add()
MAINTAINERS: Add entry for THUNDERX GPIO Driver.
gpio: Add gpio driver support for ThunderX and OCTEON-TX
gpio: mockup: use irq_sim
gpio: mxs: use devres for irq generic chip
gpio: mxc: use devres for irq generic chip
gpio: pch: use devres for irq generic chip
gpio: ml-ioh: use devres for irq generic chip
gpio: sta2x11: use devres for irq generic chip
gpio: sta2x11: disallow unbinding the driver
gpio: mxs: disallow unbinding the driver
gpio: mxc: disallow unbinding the driver
gpio: aspeed: Remove reference to clock name in debounce warning message
...
This commit is contained in:
@@ -12,6 +12,9 @@ Required properties:
|
||||
1 = active low
|
||||
- registers-number: Number of daisy-chained shift registers
|
||||
|
||||
Optional properties:
|
||||
- enable-gpios: GPIO connected to the OE (Output Enable) pin.
|
||||
|
||||
Example:
|
||||
|
||||
gpio5: gpio5@0 {
|
||||
|
||||
@@ -18,7 +18,7 @@ Required properties:
|
||||
Optional properties:
|
||||
|
||||
- interrupt-parent : The parent interrupt controller, optional if inherited
|
||||
- clocks : A phandle to the HPLL clock node for debounce timings
|
||||
- clocks : A phandle to the clock to use for debounce timings
|
||||
|
||||
The gpio and interrupt properties are further described in their respective
|
||||
bindings documentation:
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
Davinci/Keystone GPIO controller bindings
|
||||
|
||||
Required Properties:
|
||||
- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio"
|
||||
- compatible: should be "ti,dm6441-gpio": for Davinci da850 SoCs
|
||||
"ti,keystone-gpio": for Keystone 2 66AK2H/K, 66AK2L,
|
||||
66AK2E SoCs
|
||||
"ti,k2g-gpio", "ti,keystone-gpio": for 66AK2G
|
||||
|
||||
- reg: Physical base address of the controller and the size of memory mapped
|
||||
registers.
|
||||
@@ -20,7 +23,21 @@ Required Properties:
|
||||
- ti,ngpio: The number of GPIO pins supported.
|
||||
|
||||
- ti,davinci-gpio-unbanked: The number of GPIOs that have an individual interrupt
|
||||
line to processor.
|
||||
line to processor.
|
||||
|
||||
- clocks: Should contain the device's input clock, and should be defined as per
|
||||
the appropriate clock bindings consumer usage in,
|
||||
|
||||
Documentation/devicetree/bindings/clock/keystone-gate.txt
|
||||
for 66AK2HK/66AK2L/66AK2E SoCs or,
|
||||
|
||||
Documentation/devicetree/bindings/clock/ti,sci-clk.txt
|
||||
for 66AK2G SoCs
|
||||
|
||||
- clock-names: Name should be "gpio";
|
||||
|
||||
Currently clock-names and clocks are needed for all keystone 2 platforms
|
||||
Davinci platforms do not have DT clocks as of now.
|
||||
|
||||
The GPIO controller also acts as an interrupt controller. It uses the default
|
||||
two cells specifier as described in Documentation/devicetree/bindings/
|
||||
@@ -60,3 +77,73 @@ leds {
|
||||
...
|
||||
};
|
||||
};
|
||||
|
||||
Example for 66AK2G:
|
||||
|
||||
gpio0: gpio@2603000 {
|
||||
compatible = "ti,k2g-gpio", "ti,keystone-gpio";
|
||||
reg = <0x02603000 0x100>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupts = <GIC_SPI 432 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 433 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 434 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 435 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 436 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 437 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 438 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 439 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 440 IRQ_TYPE_EDGE_RISING>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
ti,ngpio = <144>;
|
||||
ti,davinci-gpio-unbanked = <0>;
|
||||
clocks = <&k2g_clks 0x001b 0x0>;
|
||||
clock-names = "gpio";
|
||||
};
|
||||
|
||||
Example for 66AK2HK/66AK2L/66AK2E:
|
||||
|
||||
gpio0: gpio@260bf00 {
|
||||
compatible = "ti,keystone-gpio";
|
||||
reg = <0x0260bf00 0x100>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
/* HW Interrupts mapped to GPIO pins */
|
||||
interrupts = <GIC_SPI 120 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 121 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 122 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 123 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 124 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 125 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 126 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 127 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 128 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 129 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 130 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 131 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 132 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 133 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 134 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 135 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 136 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 137 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 138 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 139 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 140 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 141 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 142 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 143 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 144 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 145 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 146 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 147 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 148 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 149 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 150 IRQ_TYPE_EDGE_RISING>,
|
||||
<GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
|
||||
clocks = <&clkgpio>;
|
||||
clock-names = "gpio";
|
||||
ti,ngpio = <32>;
|
||||
ti,davinci-gpio-unbanked = <32>;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,9 @@ functionality. Each pair serves 32 GPIOs. The VF610 has 5 instances of
|
||||
each, and each PORT module has its own interrupt.
|
||||
|
||||
Required properties for GPIO node:
|
||||
- compatible : Should be "fsl,<soc>-gpio", currently "fsl,vf610-gpio"
|
||||
- compatible : Should be "fsl,<soc>-gpio", below is supported list:
|
||||
"fsl,vf610-gpio"
|
||||
"fsl,imx7ulp-gpio"
|
||||
- reg : The first reg tuple represents the PORT module, the second tuple
|
||||
the GPIO module.
|
||||
- interrupts : Should be the port interrupt shared by all 32 pins.
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
Required Properties:
|
||||
|
||||
- compatible: should contain one of the following.
|
||||
- compatible: should contain one or more of the following:
|
||||
- "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller.
|
||||
- "renesas,gpio-r8a7745": for R8A7745 (RZ/G1E) compatible GPIO controller.
|
||||
- "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller.
|
||||
- "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller.
|
||||
- "renesas,gpio-r8a7790": for R8A7790 (R-Car H2) compatible GPIO controller.
|
||||
@@ -13,7 +14,14 @@ Required Properties:
|
||||
- "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller.
|
||||
- "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller.
|
||||
- "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller.
|
||||
- "renesas,gpio-rcar": for generic R-Car GPIO controller.
|
||||
- "renesas,rcar-gen1-gpio": for a generic R-Car Gen1 GPIO controller.
|
||||
- "renesas,rcar-gen2-gpio": for a generic R-Car Gen2 or RZ/G1 GPIO controller.
|
||||
- "renesas,rcar-gen3-gpio": for a generic R-Car Gen3 GPIO controller.
|
||||
- "renesas,gpio-rcar": deprecated.
|
||||
|
||||
When compatible with the generic version nodes must list the
|
||||
SoC-specific version corresponding to the platform first followed by
|
||||
the generic version.
|
||||
|
||||
- reg: Base address and length of each memory resource used by the GPIO
|
||||
controller hardware module.
|
||||
@@ -43,7 +51,7 @@ interrupt-controller/interrupts.txt.
|
||||
Example: R8A7779 (R-Car H1) GPIO controller nodes
|
||||
|
||||
gpio0: gpio@ffc40000 {
|
||||
compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
|
||||
compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio";
|
||||
reg = <0xffc40000 0x2c>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 141 0x4>;
|
||||
@@ -55,7 +63,7 @@ Example: R8A7779 (R-Car H1) GPIO controller nodes
|
||||
};
|
||||
...
|
||||
gpio6: gpio@ffc46000 {
|
||||
compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
|
||||
compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio";
|
||||
reg = <0xffc46000 0x2c>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 147 0x4>;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
===================================
|
||||
General Purpose Input/Output (GPIO)
|
||||
===================================
|
||||
|
||||
Core
|
||||
====
|
||||
|
||||
.. kernel-doc:: include/linux/gpio/driver.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: drivers/gpio/gpiolib.c
|
||||
:export:
|
||||
|
||||
Legacy API
|
||||
==========
|
||||
|
||||
The functions listed in this section are deprecated. The GPIO descriptor based
|
||||
API described above should be used in new code.
|
||||
|
||||
.. kernel-doc:: drivers/gpio/gpiolib-legacy.c
|
||||
:export:
|
||||
|
||||
ACPI support
|
||||
============
|
||||
|
||||
.. kernel-doc:: drivers/gpio/gpiolib-acpi.c
|
||||
:export:
|
||||
|
||||
Device tree support
|
||||
===================
|
||||
|
||||
.. kernel-doc:: drivers/gpio/gpiolib-of.c
|
||||
:export:
|
||||
|
||||
Device-managed API
|
||||
==================
|
||||
|
||||
.. kernel-doc:: drivers/gpio/devres.c
|
||||
:export:
|
||||
|
||||
sysfs helpers
|
||||
=============
|
||||
|
||||
.. kernel-doc:: drivers/gpio/gpiolib-sysfs.c
|
||||
:export:
|
||||
@@ -44,6 +44,7 @@ available subsections can be seen below.
|
||||
uio-howto
|
||||
firmware/index
|
||||
pinctl
|
||||
gpio
|
||||
misc_devices
|
||||
|
||||
.. only:: subproject and html
|
||||
|
||||
@@ -13018,6 +13018,11 @@ M: Yehezkel Bernat <yehezkel.bernat@intel.com>
|
||||
S: Maintained
|
||||
F: drivers/thunderbolt/
|
||||
|
||||
THUNDERX GPIO DRIVER
|
||||
M: David Daney <david.daney@cavium.com>
|
||||
S: Maintained
|
||||
F: drivers/gpio/gpio-thunderx.c
|
||||
|
||||
TI AM437X VPFE DRIVER
|
||||
M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
|
||||
L: linux-media@vger.kernel.org
|
||||
|
||||
+25
-1
@@ -311,7 +311,7 @@ config GPIO_MOCKUP
|
||||
depends on GPIOLIB && SYSFS
|
||||
select GPIO_SYSFS
|
||||
select GPIOLIB_IRQCHIP
|
||||
select IRQ_WORK
|
||||
select IRQ_SIM
|
||||
help
|
||||
This enables GPIO Testing driver, which provides a way to test GPIO
|
||||
subsystem through sysfs(or char device) and debugfs. GPIO_SYSFS
|
||||
@@ -450,6 +450,15 @@ config GPIO_TS4800
|
||||
help
|
||||
This driver support TS-4800 FPGA GPIO controllers.
|
||||
|
||||
config GPIO_THUNDERX
|
||||
tristate "Cavium ThunderX/OCTEON-TX GPIO"
|
||||
depends on ARCH_THUNDER || (64BIT && COMPILE_TEST)
|
||||
depends on PCI_MSI && IRQ_DOMAIN_HIERARCHY
|
||||
select IRQ_FASTEOI_HIERARCHY_HANDLERS
|
||||
help
|
||||
Say yes here to support the on-chip GPIO lines on the ThunderX
|
||||
and OCTEON-TX families of SoCs.
|
||||
|
||||
config GPIO_TZ1090
|
||||
bool "Toumaz Xenif TZ1090 GPIO support"
|
||||
depends on SOC_TZ1090
|
||||
@@ -1065,6 +1074,21 @@ config GPIO_TPS65912
|
||||
help
|
||||
This driver supports TPS65912 gpio chip
|
||||
|
||||
config GPIO_TPS68470
|
||||
bool "TPS68470 GPIO"
|
||||
depends on MFD_TPS68470
|
||||
help
|
||||
Select this option to enable GPIO driver for the TPS68470
|
||||
chip family.
|
||||
There are 7 GPIOs and few sensor related GPIOs supported
|
||||
by the TPS68470. While the 7 GPIOs can be configured as
|
||||
input or output as appropriate, the sensor related GPIOs
|
||||
are "output only" GPIOs.
|
||||
|
||||
This driver config is bool, as the GPIO functionality
|
||||
of the TPS68470 must be available before dependent
|
||||
drivers are loaded.
|
||||
|
||||
config GPIO_TWL4030
|
||||
tristate "TWL4030, TWL5030, and TPS659x0 GPIOs"
|
||||
depends on TWL4030_CORE
|
||||
|
||||
@@ -113,6 +113,7 @@ obj-$(CONFIG_GPIO_SYSCON) += gpio-syscon.o
|
||||
obj-$(CONFIG_GPIO_TB10X) += gpio-tb10x.o
|
||||
obj-$(CONFIG_GPIO_TC3589X) += gpio-tc3589x.o
|
||||
obj-$(CONFIG_GPIO_TEGRA) += gpio-tegra.o
|
||||
obj-$(CONFIG_GPIO_THUNDERX) += gpio-thunderx.o
|
||||
obj-$(CONFIG_GPIO_TIMBERDALE) += gpio-timberdale.o
|
||||
obj-$(CONFIG_GPIO_PALMAS) += gpio-palmas.o
|
||||
obj-$(CONFIG_GPIO_TPIC2810) += gpio-tpic2810.o
|
||||
@@ -121,6 +122,7 @@ obj-$(CONFIG_GPIO_TPS65218) += gpio-tps65218.o
|
||||
obj-$(CONFIG_GPIO_TPS6586X) += gpio-tps6586x.o
|
||||
obj-$(CONFIG_GPIO_TPS65910) += gpio-tps65910.o
|
||||
obj-$(CONFIG_GPIO_TPS65912) += gpio-tps65912.o
|
||||
obj-$(CONFIG_GPIO_TPS68470) += gpio-tps68470.o
|
||||
obj-$(CONFIG_GPIO_TS4800) += gpio-ts4800.o
|
||||
obj-$(CONFIG_GPIO_TS4900) += gpio-ts4900.o
|
||||
obj-$(CONFIG_GPIO_TS5500) += gpio-ts5500.o
|
||||
|
||||
@@ -132,6 +132,7 @@ EXPORT_SYMBOL(devm_gpiod_get_index);
|
||||
* @index: index of the GPIO to obtain in the consumer
|
||||
* @child: firmware node (child of @dev)
|
||||
* @flags: GPIO initialization flags
|
||||
* @label: label to attach to the requested GPIO
|
||||
*
|
||||
* GPIO descriptors returned from this function are automatically disposed on
|
||||
* driver detach.
|
||||
@@ -271,6 +272,7 @@ EXPORT_SYMBOL(devm_gpiod_get_array_optional);
|
||||
|
||||
/**
|
||||
* devm_gpiod_put - Resource-managed gpiod_put()
|
||||
* @dev: GPIO consumer
|
||||
* @desc: GPIO descriptor to dispose of
|
||||
*
|
||||
* Dispose of a GPIO descriptor obtained with devm_gpiod_get() or
|
||||
@@ -286,6 +288,7 @@ EXPORT_SYMBOL(devm_gpiod_put);
|
||||
|
||||
/**
|
||||
* devm_gpiod_put_array - Resource-managed gpiod_put_array()
|
||||
* @dev: GPIO consumer
|
||||
* @descs: GPIO descriptor array to dispose of
|
||||
*
|
||||
* Dispose of an array of GPIO descriptors obtained with devm_gpiod_get_array().
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/spi/spi.h>
|
||||
@@ -31,6 +32,7 @@ struct gen_74x164_chip {
|
||||
* numbering, store the bytes in reverse order.
|
||||
*/
|
||||
u8 buffer[0];
|
||||
struct gpio_desc *gpiod_oe;
|
||||
};
|
||||
|
||||
static int __gen_74x164_write_config(struct gen_74x164_chip *chip)
|
||||
@@ -126,6 +128,13 @@ static int gen_74x164_probe(struct spi_device *spi)
|
||||
if (!chip)
|
||||
return -ENOMEM;
|
||||
|
||||
chip->gpiod_oe = devm_gpiod_get_optional(&spi->dev, "enable",
|
||||
GPIOD_OUT_LOW);
|
||||
if (IS_ERR(chip->gpiod_oe))
|
||||
return PTR_ERR(chip->gpiod_oe);
|
||||
|
||||
gpiod_set_value_cansleep(chip->gpiod_oe, 1);
|
||||
|
||||
spi_set_drvdata(spi, chip);
|
||||
|
||||
chip->gpio_chip.label = spi->modalias;
|
||||
@@ -164,6 +173,7 @@ static int gen_74x164_remove(struct spi_device *spi)
|
||||
{
|
||||
struct gen_74x164_chip *chip = spi_get_drvdata(spi);
|
||||
|
||||
gpiod_set_value_cansleep(chip->gpiod_oe, 0);
|
||||
gpiochip_remove(&chip->gpio_chip);
|
||||
mutex_destroy(&chip->lock);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ static int altr_a10sr_gpio_direction_output(struct gpio_chip *gc,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static struct gpio_chip altr_a10sr_gc = {
|
||||
static const struct gpio_chip altr_a10sr_gc = {
|
||||
.label = "altr_a10sr_gpio",
|
||||
.owner = THIS_MODULE,
|
||||
.get = altr_a10sr_gpio_get,
|
||||
|
||||
@@ -324,8 +324,8 @@ skip_irq:
|
||||
return 0;
|
||||
teardown:
|
||||
of_mm_gpiochip_remove(&altera_gc->mmchip);
|
||||
pr_err("%s: registration failed with status %d\n",
|
||||
node->full_name, ret);
|
||||
pr_err("%pOF: registration failed with status %d\n",
|
||||
node, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -834,7 +834,7 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
|
||||
gpio->clk = of_clk_get(pdev->dev.of_node, 0);
|
||||
if (IS_ERR(gpio->clk)) {
|
||||
dev_warn(&pdev->dev,
|
||||
"No HPLL clock phandle provided, debouncing disabled\n");
|
||||
"Failed to get clock from devicetree, debouncing disabled\n");
|
||||
gpio->clk = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -339,6 +339,7 @@ static int brcmstb_gpio_irq_setup(struct platform_device *pdev,
|
||||
struct brcmstb_gpio_priv *priv = bank->parent_priv;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
int err;
|
||||
|
||||
bank->irq_chip.name = dev_name(dev);
|
||||
bank->irq_chip.irq_mask = brcmstb_gpio_irq_mask;
|
||||
@@ -355,8 +356,6 @@ static int brcmstb_gpio_irq_setup(struct platform_device *pdev,
|
||||
dev_warn(dev,
|
||||
"Couldn't get wake IRQ - GPIOs will not be able to wake from sleep");
|
||||
} else {
|
||||
int err;
|
||||
|
||||
/*
|
||||
* Set wakeup capability before requesting wakeup
|
||||
* interrupt, so we can process boot-time "wakeups"
|
||||
@@ -383,8 +382,10 @@ static int brcmstb_gpio_irq_setup(struct platform_device *pdev,
|
||||
if (priv->can_wake)
|
||||
bank->irq_chip.irq_set_wake = brcmstb_gpio_irq_set_wake;
|
||||
|
||||
gpiochip_irqchip_add(&bank->gc, &bank->irq_chip, 0,
|
||||
handle_simple_irq, IRQ_TYPE_NONE);
|
||||
err = gpiochip_irqchip_add(&bank->gc, &bank->irq_chip, 0,
|
||||
handle_simple_irq, IRQ_TYPE_NONE);
|
||||
if (err)
|
||||
return err;
|
||||
gpiochip_set_chained_irqchip(&bank->gc, &bank->irq_chip,
|
||||
priv->parent_irq, brcmstb_gpio_irq_handler);
|
||||
|
||||
@@ -483,7 +484,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
|
||||
|
||||
gc->of_node = np;
|
||||
gc->owner = THIS_MODULE;
|
||||
gc->label = np->full_name;
|
||||
gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
|
||||
gc->base = gpio_base;
|
||||
gc->of_gpio_n_cells = 2;
|
||||
gc->of_xlate = brcmstb_gpio_of_xlate;
|
||||
|
||||
@@ -166,7 +166,7 @@ of_err:
|
||||
static int davinci_gpio_probe(struct platform_device *pdev)
|
||||
{
|
||||
static int ctrl_num, bank_base;
|
||||
int gpio, bank;
|
||||
int gpio, bank, ret = 0;
|
||||
unsigned ngpio, nbank;
|
||||
struct davinci_gpio_controller *chips;
|
||||
struct davinci_gpio_platform_data *pdata;
|
||||
@@ -232,10 +232,23 @@ static int davinci_gpio_probe(struct platform_device *pdev)
|
||||
for (gpio = 0, bank = 0; gpio < ngpio; gpio += 32, bank++)
|
||||
chips->regs[bank] = gpio_base + offset_array[bank];
|
||||
|
||||
gpiochip_add_data(&chips->chip, chips);
|
||||
ret = devm_gpiochip_add_data(dev, &chips->chip, chips);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
platform_set_drvdata(pdev, chips);
|
||||
davinci_gpio_irq_setup(pdev);
|
||||
ret = davinci_gpio_irq_setup(pdev);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
/* Revert the static variable increments */
|
||||
ctrl_num--;
|
||||
bank_base -= ngpio;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -477,8 +490,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
|
||||
|
||||
clk = devm_clk_get(dev, "gpio");
|
||||
if (IS_ERR(clk)) {
|
||||
printk(KERN_ERR "Error %ld getting gpio clock?\n",
|
||||
PTR_ERR(clk));
|
||||
dev_err(dev, "Error %ld getting gpio clock\n", PTR_ERR(clk));
|
||||
return PTR_ERR(clk);
|
||||
}
|
||||
ret = clk_prepare_enable(clk);
|
||||
|
||||
@@ -76,8 +76,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
/* Setup pointers to chip functions */
|
||||
gc->label = devm_kstrdup(&pdev->dev, pdev->dev.of_node->full_name,
|
||||
GFP_KERNEL);
|
||||
gc->label = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOF", pdev->dev.of_node);
|
||||
if (!gc->label) {
|
||||
ret = -ENOMEM;
|
||||
goto err0;
|
||||
@@ -96,8 +95,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
err0:
|
||||
iounmap(regs);
|
||||
pr_err("%s: GPIO chip registration failed\n",
|
||||
pdev->dev.of_node->full_name);
|
||||
pr_err("%pOF: GPIO chip registration failed\n", pdev->dev.of_node);
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ static int grgpio_probe(struct platform_device *ofdev)
|
||||
gc->of_node = np;
|
||||
gc->owner = THIS_MODULE;
|
||||
gc->to_irq = grgpio_to_irq;
|
||||
gc->label = np->full_name;
|
||||
gc->label = devm_kasprintf(&ofdev->dev, GFP_KERNEL, "%pOF", np);
|
||||
gc->base = -1;
|
||||
|
||||
err = of_property_read_u32(np, "nbits", &prop);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* GPIO interface for IT87xx Super I/O chips
|
||||
*
|
||||
* Author: Diego Elio Pettenò <flameeyes@flameeyes.eu>
|
||||
* Copyright (c) 2017 Google, Inc.
|
||||
*
|
||||
* Based on it87_wdt.c by Oliver Schuster
|
||||
* gpio-it8761e.c by Denis Turischev
|
||||
@@ -39,6 +40,7 @@
|
||||
#define IT8728_ID 0x8728
|
||||
#define IT8732_ID 0x8732
|
||||
#define IT8761_ID 0x8761
|
||||
#define IT8772_ID 0x8772
|
||||
|
||||
/* IO Ports */
|
||||
#define REG 0x2e
|
||||
@@ -314,6 +316,7 @@ static int __init it87_gpio_init(void)
|
||||
break;
|
||||
case IT8728_ID:
|
||||
case IT8732_ID:
|
||||
case IT8772_ID:
|
||||
gpio_ba_reg = 0x62;
|
||||
it87_gpio->io_size = 8;
|
||||
it87_gpio->output_base = 0xc8;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user