aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-rpi/gpio-mcp23s08-pullups.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-12-18 06:38:33 +0000
committerTimo Teräs <timo.teras@iki.fi>2015-12-18 06:59:06 +0000
commit57a77853ac8b73c8d596d76b0cfc817778c73699 (patch)
tree9d4e78c2d539b7fdb79f221d5af7eabb2e652e8a /main/linux-rpi/gpio-mcp23s08-pullups.patch
parent218c9e63e3db210702c05f5122417f9dddcbe5dd (diff)
downloadaports-57a77853ac8b73c8d596d76b0cfc817778c73699.tar.bz2
aports-57a77853ac8b73c8d596d76b0cfc817778c73699.tar.xz
main/linux-rpi: upgrade to 4.1.15, update patches and config
Diffstat (limited to 'main/linux-rpi/gpio-mcp23s08-pullups.patch')
-rw-r--r--main/linux-rpi/gpio-mcp23s08-pullups.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/main/linux-rpi/gpio-mcp23s08-pullups.patch b/main/linux-rpi/gpio-mcp23s08-pullups.patch
new file mode 100644
index 0000000000..e3039861a8
--- /dev/null
+++ b/main/linux-rpi/gpio-mcp23s08-pullups.patch
@@ -0,0 +1,67 @@
+From 0be0dc3a75279c4621ff45a027ffad5ddc9810c7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Mon, 30 Nov 2015 16:24:25 +0200
+Subject: [PATCH] gpio: mcp23s08: support setting pullups from device tree data
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Make pullup configurable from device tree data.
+
+Signed-off-by: Timo Teräs <timo.teras@iki.fi>
+---
+ Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt | 1 +
+ drivers/gpio/gpio-mcp23s08.c | 14 +++++++++++---
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
+index f3332b9..c7d2128 100644
+--- a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
++++ b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
+@@ -59,6 +59,7 @@ Optional device specific properties:
+ On devices with only one interrupt output this property is useless.
+ - microchip,irq-active-high: Sets the INTPOL flag in the IOCON register. This
+ configures the IRQ output polarity as active high.
++- microchip,pullups: Configuration value for GPPU register.
+
+ Example I2C (with interrupt):
+ gpiom1: gpio@20 {
+diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
+index 73db7ec..2320230 100644
+--- a/drivers/gpio/gpio-mcp23s08.c
++++ b/drivers/gpio/gpio-mcp23s08.c
+@@ -786,9 +786,12 @@ static int mcp230xx_probe(struct i2c_client *client,
+ match = of_match_device(of_match_ptr(mcp23s08_i2c_of_match),
+ &client->dev);
+ if (match) {
++ u32 pullups = 0;
+ pdata = &local_pdata;
+ pdata->base = -1;
+- pdata->chip[0].pullups = 0;
++ of_property_read_u32(client->dev.of_node, "microchip,pullups",
++ &pullups);
++ pdata->chip[0].pullups = pullups;
+ pdata->irq_controller = of_property_read_bool(
+ client->dev.of_node,
+ "interrupt-controller");
+@@ -910,9 +913,14 @@ static int mcp23s08_probe(struct spi_device *spi)
+ pdata = &local_pdata;
+ pdata->base = -1;
+ for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) {
+- pdata->chip[addr].pullups = 0;
+- if (spi_present_mask & (1 << addr))
++ u32 pullups = 0;
++ if (spi_present_mask & (1 << addr)) {
++ of_property_read_u32_index(spi->dev.of_node,
++ "microchip,pullups",
++ addr, &pullups);
+ chips++;
++ }
++ pdata->chip[addr].pullups = pullups;
+ }
+ pdata->irq_controller = of_property_read_bool(
+ spi->dev.of_node,
+--
+2.6.3
+
+