Skip to contentSkip to conversation

pinctrl: bcm2835: add pinctrl pre-processor define

PATCH In review Alexander Stein 3 participants 6 messages Apr 12, 2015 – Apr 13, 2015 2 messages not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 pinctrl: bcm2835: add pinctrl pre-processor define

This adds defines for the BCM2835 function selections. This is notably useful as the functions are not ordered.

---
 include/dt-bindings/pinctrl/bcm2835.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 include/dt-bindings/pinctrl/bcm2835.h
include/dt-bindings/pinctrl/bcm2835.h new file +20 -0
new file mode 100644
index 000000000000..e90f437ce4a6
@@ -0,0 +1,20 @@
+/*
+ * This header provides constants for bcm2835 pinctrl bindings.
+ *
+ * Copyright (C) 2015 Alexander Stein <alexanders83-S0/[email protected]>
+ *
+ */
+
+#ifndef __DT_BINDINGS_BCM2835_PINCTRL_H__
+#define __DT_BINDINGS_BCM2835_PINCTRL_H__
+
+#define BCM2835_GPIO_INPUT		0
+#define BCM2835_GPIO_OUTPUT	1
+#define BCM2835_GPIO_ALT0		4
+#define BCM2835_GPIO_ALT1		5
+#define BCM2835_GPIO_ALT2		6
+#define BCM2835_GPIO_ALT3		7
+#define BCM2835_GPIO_ALT4		3
+#define BCM2835_GPIO_ALT5		2
+
+#endif /* __DT_BINDINGS_BCM2835_PINCTRL_H__ */
Signature · 6 lines
2.3.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1428842036-14202-1-git-send-email-alexanders83-S0/[email protected]

#2 lore raw

PATCH 2/2 ARM: bcm2835: Use pinctrl defines

Using the more descriptive defines rather than pure numbers we can rid of the comments.
We need to use #include to use CPP for the new include directory.

---
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 4 ++--
 arch/arm/boot/dts/bcm2835-rpi-b.dts      | 6 +++---
 arch/arm/boot/dts/bcm2835-rpi.dtsi       | 8 ++++----
 arch/arm/boot/dts/bcm2835.dtsi           | 3 ++-
 4 files changed, 11 insertions(+), 10 deletions(-)
arch/arm/boot/dts/bcm2835-rpi-b-plus.dts +2 -2
index e479515099c3..672b8c5d6a62 100644
@@ -1,5 +1,5 @@
 /dts-v1/;
-/include/ "bcm2835-rpi.dtsi"
+#include "bcm2835-rpi.dtsi"
 
 / {
 	compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
@@ -25,6 +25,6 @@
 	/* I2S interface */
 	i2s_alt0: i2s_alt0 {
 		brcm,pins = <18 19 20 21>;
-		brcm,function = <4>; /* alt0 */
+		brcm,function = <BCM2835_GPIO_ALT0>;
 	};
 };
arch/arm/boot/dts/bcm2835-rpi-b.dts +3 -3
index bafa46fc226a..ae0f1a930630 100644
@@ -1,5 +1,5 @@
 /dts-v1/;
-/include/ "bcm2835-rpi.dtsi"
+#include "bcm2835-rpi.dtsi"
 
 / {
 	compatible = "raspberrypi,model-b", "brcm,bcm2835";
@@ -18,6 +18,6 @@
 	/* I2S interface */
 	i2s_alt2: i2s_alt2 {
 		brcm,pins = <28 29 30 31>;
-		brcm,function = <6>; /* alt2 */
+		brcm,function = <BCM2835_GPIO_ALT2>;
 	};
-};
+};
\ No newline at end of file
arch/arm/boot/dts/bcm2835-rpi.dtsi +4 -4
index c7064487017d..1b484703f57c 100644
@@ -1,4 +1,4 @@
-/include/ "bcm2835.dtsi"
+#include "bcm2835.dtsi"
 
 / {
 	memory {
@@ -21,17 +21,17 @@
 
 	gpioout: gpioout {
 		brcm,pins = <6>;
-		brcm,function = <1>; /* GPIO out */
+		brcm,function = <BCM2835_GPIO_OUTPUT>;
 	};
 
 	alt0: alt0 {
 		brcm,pins = <0 1 2 3 4 5 7 8 9 10 11 14 15 40 45>;
-		brcm,function = <4>; /* alt0 */
+		brcm,function = <BCM2835_GPIO_ALT0>;
 	};
 
 	alt3: alt3 {
 		brcm,pins = <48 49 50 51 52 53>;
-		brcm,function = <7>; /* alt3 */
+		brcm,function = <BCM2835_GPIO_ALT3>;
 	};
 };
 
arch/arm/boot/dts/bcm2835.dtsi +2 -1
index 3342cb1407bc..e39737ba47b4 100644
@@ -1,4 +1,5 @@
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
+#include <dt-bindings/pinctrl/bcm2835.h>
 
 / {
 	compatible = "brcm,bcm2835";
Signature · 6 lines
2.3.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to a message not in the archive

Hi Alexander,

Quoted 6 lines

Alexander Stein <alexanders83-S0/[email protected]> hat am 12. April 2015 um 14:33 geschrieben:

This adds defines for the BCM2835 function selections. This is notably useful as the functions are not ordered.

if you look at Lee's repository then you will see this is already implemented.

Best regards
Stefan
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1128901690.288098.1428942677965.JavaMail.open-xchange-h4m1HHXQYNGvCDav5jC2oMgmgJlYmuWJ@public.gmane.org

#6 lore raw

On Monday 13 April 2015, 18:31:17 wrote Stefan Wahren:

Quoted 10 lines

Hi Alexander,

Quoted 6 lines

Alexander Stein <alexanders83-S0/[email protected]> hat am 12. April 2015 um 14:33 geschrieben:

This adds defines for the BCM2835 function selections. This is notably useful as the functions are not ordered.

if you look at Lee's repository then you will see this is already

implemented.

Thanks for that information. But I've yet to find it, those 2 on
https://git.kernel.org/cgit/ don't seem to contain that. Could you please give me an URL for that repository + branch? Thanks a lot.

Best regards,
Alexander

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

Hi Alexander,

Quoted 14 lines

Alexander Stein <alexanders83-S0/[email protected]> hat am 13. April 2015 um 19:43 geschrieben:

On Monday 13 April 2015, 18:31:17 wrote Stefan Wahren:

Quoted 9 lines

Hi Alexander,

Quoted 6 lines

Alexander Stein <alexanders83-S0/[email protected]> hat am 12. April 2015 um 14:33 geschrieben:

This adds defines for the BCM2835 function selections. This is notably useful as the functions are not ordered.

Quoted 6 lines
Quoted 1 line

if you look at Lee's repository then you will see this is already

implemented.

Thanks for that information. But I've yet to find it, those 2 on
https://git.kernel.org/cgit/ don't seem to contain that. Could you please give me an URL for that repository + branch? Thanks a lot.

sorry for the confusion:

https://git.kernel.org/cgit/linux/kernel/git/rpi/linux-rpi.git/log/?h=for-rpi-next

Quoted 4 lines

Best regards,
Alexander

Stefan
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html