Skip to contentSkip to conversation

mfd: arizona: Add DT binding for irq_gpio property

PATCH Superseded Sebastien Jan 2 participants 3 messages Nov 3, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: arizona: Add DT binding for irq_gpio property

---
 drivers/mfd/arizona-core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/mfd/arizona-core.c +5 -0
index 44cfdbb..23a0f93 100644
@@ -814,6 +814,11 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
 		count++;
 	}
 
+	arizona->pdata.irq_gpio = of_get_named_gpio(arizona->dev->of_node,
+							"wlf,irq_gpio", 0);
+	if (arizona->pdata.irq_gpio < 0)
+		arizona->pdata.irq_gpio = 0;
+
 	return 0;
 }
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 10 lines · Sebastien Jan
---
 drivers/mfd/arizona-core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/mfd/arizona-core.c +0 -0
index 44cfdbb..23a0f93 100644

drivers/mfd/arizona-core.c static int arizona_of_get_core_pdata(struct arizona *arizona) · line 820

Quoted 7 lines
drivers/mfd/arizona-core.c +4 -0
@@ -814,6 +814,11 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
 		count++;
 	}
 
+	arizona->pdata.irq_gpio = of_get_named_gpio(arizona->dev->of_node,
+							"wlf,irq_gpio", 0);
+	if (arizona->pdata.irq_gpio < 0)
+		arizona->pdata.irq_gpio = 0;

This is wrong on a number of levels.

Firstly, all properties must be documented. Secondly, underscores aren't allowed in DT. Thirdly, this is a generic binding -- no need for the vendor prefix. And lastly, GPIO bindings already have a format -- it should be simply 'irq-gpios'.

Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#2 lore raw
Quoted 21 lines · Lee Jones
Quoted 10 lines · Sebastien Jan
---
  drivers/mfd/arizona-core.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/mfd/arizona-core.c +0 -0
index 44cfdbb..23a0f93 100644

drivers/mfd/arizona-core.c static int arizona_of_get_core_pdata(struct arizona *arizona) · line 820

Quoted 7 lines
drivers/mfd/arizona-core.c +4 -0
@@ -814,6 +814,11 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
  		count++;
  	}
 
+	arizona->pdata.irq_gpio = of_get_named_gpio(arizona->dev->of_node,
+							"wlf,irq_gpio", 0);
+	if (arizona->pdata.irq_gpio < 0)
+		arizona->pdata.irq_gpio = 0;

This is wrong on a number of levels.

Quoted 4 lines

Firstly, all properties must be documented. Secondly, underscores aren't allowed in DT. Thirdly, this is a generic binding -- no need for the vendor prefix. And lastly, GPIO bindings already have a format -- it should be simply 'irq-gpios'.

Thanks Lee, I'll post a v2 with these changes (and updated bindings document).