Skip to contentSkip to conversation

gpio: gpio-generic: add dt support

PATCH Superseded Antony Pavlov 2 participants 4 messages Sep 5, 2017 – Sep 6, 2017 GPIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover gpio: gpio-generic: add dt support

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

 drivers/gpio/gpio-generic.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
Signature · 7 lines
2.13.3


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

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

---
 drivers/gpio/gpio-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-generic.c +1 -1
index c6202fc651..164aaed97a 100644
@@ -327,7 +327,7 @@ static void __iomem *bgpio_map(struct device_d *dev, const char *name,
 		return NULL;
 	}
 
-	return ret;
+	return IOMEM(r->start);
 }
 
 static int bgpio_dev_probe(struct device_d *dev)
Signature · 7 lines
2.13.3


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

Re: [PATCH 1/2] gpio: gpio-generic: fix bgpio_map()

Quoted 10 lines · Antony Pavlov
---
 drivers/gpio/gpio-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-generic.c +0 -0
index c6202fc651..164aaed97a 100644

drivers/gpio/gpio-generic.c static void __iomem *bgpio_map(struct device_d *dev, const char *name, · line 331

Quoted 6 lines
drivers/gpio/gpio-generic.c +1 -1
@@ -327,7 +327,7 @@ static void __iomem *bgpio_map(struct device_d *dev, const char *name,
 		return NULL;
 	}
 
-	return ret;
+	return IOMEM(r->start);
 }

This still looks wrong. We have:

	void __iomem *ret;

	...

	ret = request_iomem_region(dev_name(dev), r->start, r->end);

request_iomem_region() returns a struct resource * from which you should return the start element.

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
#3 lore raw

PATCH 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 164aaed97a..4d8f14c879 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.13.3


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