pinctrl: bcm2835: add pinctrl pre-processor define
Subsystems (4)
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
@@ -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
PATCH 2/2 ARM: bcm2835: Use pinctrl defines
In reply to a message not in the archiveUsing 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
@@ -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
@@ -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>; }; -}; +};
arch/arm/boot/dts/bcm2835-rpi.dtsi +4 -4
@@ -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
@@ -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
Stephen Warren
Acked-byQuoted 2 lines · Alexander Stein
This adds defines for the BCM2835 function selections. This is notably useful as the functions are not ordered.
The series,
--
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
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
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
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