Skip to contentSkip to conversation

gpio: gpio-generic: add dt support

PATCH Applied Antony Pavlov 2 participants 4 messages Sep 7, 2017 – Sep 8, 2017 GPIO

lore
Share & tools
lore
#0 lore raw

v2 cover gpio: gpio-generic: add dt support

Changes since v1:

* fix 'gpio: gpio-generic: fix bgpio_map()' according to Sascha's remark see http://lists.infradead.org/pipermail/barebox/2017-September/031044.html for details.

Antony Pavlov (2):
gpio: gpio-generic: fix bgpio_map()
gpio: gpio-generic: add dt support

 drivers/gpio/gpio-generic.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
Signature · 7 lines
2.14.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH v2 1/2 gpio: gpio-generic: fix bgpio_map()

---
 drivers/gpio/gpio-generic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-generic.c +2 -2
index c6202fc651..01a66d6645 100644
@@ -308,7 +308,7 @@ static void __iomem *bgpio_map(struct device_d *dev, const char *name,
 			       resource_size_t sane_sz, int *err)
 {
 	struct resource *r;
-	void __iomem *ret;
+	struct resource *ret;
 
 	*err = 0;
 
@@ -327,7 +327,7 @@ static void __iomem *bgpio_map(struct device_d *dev, const char *name,
 		return NULL;
 	}
 
-	return ret;
+	return IOMEM(ret->start);
 }
 
 static int bgpio_dev_probe(struct device_d *dev)
Signature · 7 lines
2.14.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH v2 2/2 gpio: gpio-generic: add dt support

In reply to Antony Pavlov
---
 drivers/gpio/gpio-generic.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpio/gpio-generic.c +9 -0
index 01a66d6645..14b451bfff 100644
@@ -410,9 +410,18 @@ static struct platform_device_id bgpio_id_table[] = {
 	{ }
 };
 
+static struct of_device_id __maybe_unused bgpio_of_match[] = {
+	{
+		.compatible = "wd,mbl-gpio",
+	}, {
+		/* sentinel */
+	}
+};
+
 static struct driver_d bgpio_driver = {
 	.name		= "basic-mmio-gpio",
 	.id_table	= bgpio_id_table,
+	.of_compatible	= DRV_OF_COMPAT(bgpio_of_match),
 	.probe		= bgpio_dev_probe,
 	.remove		= bgpio_dev_remove,
 };
Signature · 7 lines
2.14.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#3 lore raw
In reply to Antony Pavlov
Quoted 6 lines · Antony Pavlov

Changes since v1:

* fix 'gpio: gpio-generic: fix bgpio_map()' according to Sascha's remark see http://lists.infradead.org/pipermail/barebox/2017-September/031044.html for details.

Quoted 7 lines

Antony Pavlov (2):
gpio: gpio-generic: fix bgpio_map()
gpio: gpio-generic: add dt support

 drivers/gpio/gpio-generic.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox