* [PATCH] dts: cubox: Map gpio-keys and pps-gpio to gpio3 8
@ 2015-03-16 20:36 George Joseph
2015-03-16 20:50 ` Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: George Joseph @ 2015-03-16 20:36 UTC (permalink / raw)
To: Shawn Guo, Sascha Hauer, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Russell King,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
The Cubox has a recessed button between the HDMI and RJ-45 connectors
that wasn't mapped in the device tree. Since the button is normally
open and there's no external pull up/down, that pad (EIM_DA8) can be
used for almost anything so I've mapped it to gpio-keys BTN_0 and
pps-gpio. Whichever driver claims it first wins. If both drivers
are build as modules, you can even switch between them at run time
and the pinmux will adjust the pin configuration as required.
If neither driver claims the gpio, it's still available in the normal
gpio sysfs.
Signed-off-by: George Joseph <george.joseph-H+B1fhQ+CpcEVd8bySq3Wg@public.gmane.org>
Tested-by: George Joseph <george.joseph-H+B1fhQ+CpcEVd8bySq3Wg@public.gmane.org>
---
arch/arm/boot/dts/imx6qdl-cubox-i.dtsi | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
index 6a524ca..7479fb6 100644
--- a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
@@ -3,6 +3,8 @@
*/
#include "imx6qdl-microsom.dtsi"
#include "imx6qdl-microsom-ar8035.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
/ {
ir_recv: ir-receiver {
@@ -66,6 +68,26 @@
spdif-controller = <&spdif>;
spdif-out;
};
+
+ pps {
+ compatible = "pps-gpio";
+ pinctrl-0 = <&pinctrl_gpio_pps>;
+ pinctrl-names = "default";
+ gpios = <&gpio3 8 0>;
+ interrupt-parent = <&intc>;
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+ pinctrl-0 = <&pinctrl_gpio_key>;
+ pinctrl-names = "default";
+
+ button_0 {
+ label = "Button 0";
+ gpios = <&gpio3 8 GPIO_ACTIVE_LOW>;
+ linux,code = <BTN_0>;
+ };
+ };
};
&hdmi {
@@ -170,6 +192,18 @@
MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x13059
>;
};
+
+ pinctrl_gpio_pps: gpio-pps {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_DA8__GPIO3_IO08 0x130c1
+ >;
+ };
+
+ pinctrl_gpio_key: gpio-key {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_DA8__GPIO3_IO08 0x17059
+ >;
+ };
};
};
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dts: cubox: Map gpio-keys and pps-gpio to gpio3 8
2015-03-16 20:36 [PATCH] dts: cubox: Map gpio-keys and pps-gpio to gpio3 8 George Joseph
@ 2015-03-16 20:50 ` Russell King - ARM Linux
[not found] ` <20150316205004.GO8656-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2015-03-16 20:50 UTC (permalink / raw)
To: George Joseph
Cc: Shawn Guo, Sascha Hauer, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, linux-arm-kernel, devicetree,
linux-kernel
On Mon, Mar 16, 2015 at 02:36:41PM -0600, George Joseph wrote:
> The Cubox has a recessed button between the HDMI and RJ-45 connectors
> that wasn't mapped in the device tree. Since the button is normally
> open and there's no external pull up/down, that pad (EIM_DA8) can be
> used for almost anything so I've mapped it to gpio-keys BTN_0 and
> pps-gpio. Whichever driver claims it first wins. If both drivers
> are build as modules, you can even switch between them at run time
> and the pinmux will adjust the pin configuration as required.
> If neither driver claims the gpio, it's still available in the normal
> gpio sysfs.
I wonder why we want to have the PPS support in mainline, given that
you would need to solder to the board to make use of that. I can see
the point of the gpio-keys going into mainline, but not the PPS bit.
That's more like a local hack.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dts: cubox: Map gpio-keys and pps-gpio to gpio3 8
[not found] ` <20150316205004.GO8656-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
@ 2015-03-16 21:33 ` George Joseph
0 siblings, 0 replies; 3+ messages in thread
From: George Joseph @ 2015-03-16 21:33 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Shawn Guo, Sascha Hauer, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, linux-arm-kern.,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Mon, Mar 16, 2015 at 2:50 PM, Russell King - ARM Linux
<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org> wrote:
> On Mon, Mar 16, 2015 at 02:36:41PM -0600, George Joseph wrote:
>> The Cubox has a recessed button between the HDMI and RJ-45 connectors
>> that wasn't mapped in the device tree. Since the button is normally
>> open and there's no external pull up/down, that pad (EIM_DA8) can be
>> used for almost anything so I've mapped it to gpio-keys BTN_0 and
>> pps-gpio. Whichever driver claims it first wins. If both drivers
>> are build as modules, you can even switch between them at run time
>> and the pinmux will adjust the pin configuration as required.
>> If neither driver claims the gpio, it's still available in the normal
>> gpio sysfs.
>
> I wonder why we want to have the PPS support in mainline, given that
> you would need to solder to the board to make use of that. I can see
> the point of the gpio-keys going into mainline, but not the PPS bit.
> That's more like a local hack.
>
Well, it was just one less thing I'd have to patch locally for so I
took a chance. :) I'll remove the pps bits and resubmit.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-16 21:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-16 20:36 [PATCH] dts: cubox: Map gpio-keys and pps-gpio to gpio3 8 George Joseph
2015-03-16 20:50 ` Russell King - ARM Linux
[not found] ` <20150316205004.GO8656-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-03-16 21:33 ` George Joseph
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).