diff mbox series

[V4,06/15] ARM: dts: imx6q-dhcom: Add keys and leds to the PDK2 board

Message ID 20210629135612.60695-6-cniedermaier@dh-electronics.com (mailing list archive)
State New, archived
Headers show
Series [V4,01/15] ARM: dts: imx6q-dhcom: Add the parallel system bus | expand

Commit Message

Christoph Niedermaier June 29, 2021, 1:56 p.m. UTC
On the PDK2 there are 4 keys and 4 leds. DHCOM GPIOs are
used for that, but one led isn't useable, because the GPIO
is already used as touch interrupt.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: kernel@dh-electronics.com
To: linux-arm-kernel@lists.infradead.org
---
V2: - Rebase on Shawn Guos branch for-next
V3: - Fix typo in commit message
    - Replace the property label with the
      properties color and function
V4: - Include dt-bindings/leds/common.h file
---
 arch/arm/boot/dts/imx6q-dhcom-pdk2.dts | 92 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx6q-dhcom-som.dtsi |  1 +
 2 files changed, 93 insertions(+)

Comments

Marek Vasut June 29, 2021, 3:10 p.m. UTC | #1
On 6/29/21 3:56 PM, Christoph Niedermaier wrote:

[...]

> diff --git a/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts b/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
> index 6bb7129d0498..ff794a77c5db 100644
> --- a/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
> +++ b/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts

[...]

> +	led {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_leds_pdk2>;
> +
> +		/*
> +		 * Disable led-5, because GPIO E is
> +		 * already used as touch interrupt.
> +		 */
> +		led-5 {
> +			color = <LED_COLOR_ID_GREEN>;
> +			function = LED_FUNCTION_INDICATOR;
> +			gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* GPIO E */
> +			default-state = "off";
> +			status = "disabled";
> +		};

[...]

> diff --git a/arch/arm/boot/dts/imx6q-dhcom-som.dtsi b/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
> index c5c060c6b9bf..68ac29d28f4f 100644
> --- a/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
> +++ b/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
> @@ -9,6 +9,7 @@
>   #include <dt-bindings/gpio/gpio.h>
>   #include <dt-bindings/clock/imx6qdl-clock.h>
>   #include <dt-bindings/input/input.h>
> +#include <dt-bindings/leds/common.h>

The LEDs are optionally present on some of the carrier boards, so this 
header should be included in the carrier board .dts file I think.
Christoph Niedermaier June 30, 2021, 12:16 p.m. UTC | #2
From: Marek Vasut [mailto:marex@denx.de]
Sent: Tuesday, June 29, 2021 5:10 PM
> On 6/29/21 3:56 PM, Christoph Niedermaier wrote:
> 
> [...]
> 
>> diff --git a/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts b/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
>> index 6bb7129d0498..ff794a77c5db 100644
>> --- a/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
>> +++ b/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
> 
> [...]
> 
>> +     led {
>> +             compatible = "gpio-leds";
>> +             pinctrl-names = "default";
>> +             pinctrl-0 = <&pinctrl_leds_pdk2>;
>> +
>> +             /*
>> +              * Disable led-5, because GPIO E is
>> +              * already used as touch interrupt.
>> +              */
>> +             led-5 {
>> +                     color = <LED_COLOR_ID_GREEN>;
>> +                     function = LED_FUNCTION_INDICATOR;
>> +                     gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* GPIO E */
>> +                     default-state = "off";
>> +                     status = "disabled";
>> +             };
> 
> [...]
> 
>> diff --git a/arch/arm/boot/dts/imx6q-dhcom-som.dtsi b/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
>> index c5c060c6b9bf..68ac29d28f4f 100644
>> --- a/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
>> +++ b/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
>> @@ -9,6 +9,7 @@
>>   #include <dt-bindings/gpio/gpio.h>
>>   #include <dt-bindings/clock/imx6qdl-clock.h>
>>   #include <dt-bindings/input/input.h>
>> +#include <dt-bindings/leds/common.h>
> 
> The LEDs are optionally present on some of the carrier boards, so this
> header should be included in the carrier board .dts file I think.

Thanks, will fix this in version 5.

Regards
Christoph
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts b/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
index 6bb7129d0498..ff794a77c5db 100644
--- a/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
+++ b/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
@@ -57,6 +57,80 @@ 
 		};
 	};
 
+	gpio-keys {
+		#size-cells = <0>;
+		compatible = "gpio-keys";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_keys_pdk2>;
+
+		button-0 {
+			label = "TA1-GPIO-A";
+			linux,code = <KEY_A>;
+			gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
+			wakeup-source;
+		};
+
+		button-1 {
+			label = "TA2-GPIO-B";
+			linux,code = <KEY_B>;
+			gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
+			wakeup-source;
+		};
+
+		button-2 {
+			label = "TA3-GPIO-C";
+			linux,code = <KEY_C>;
+			gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
+			wakeup-source;
+		};
+
+		button-3 {
+			label = "TA4-GPIO-D";
+			linux,code = <KEY_D>;
+			gpios = <&gpio6 3 GPIO_ACTIVE_LOW>;
+			wakeup-source;
+		};
+	};
+
+	led {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_leds_pdk2>;
+
+		/*
+		 * Disable led-5, because GPIO E is
+		 * already used as touch interrupt.
+		 */
+		led-5 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* GPIO E */
+			default-state = "off";
+			status = "disabled";
+		};
+
+		led-6 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			gpios = <&gpio4 20 GPIO_ACTIVE_HIGH>; /* GPIO F */
+			default-state = "off";
+		};
+
+		led-7 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			gpios = <&gpio4 7 GPIO_ACTIVE_HIGH>; /* GPIO H */
+			default-state = "off";
+		};
+
+		led-8 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>; /* GPIO I */
+			default-state = "off";
+		};
+	};
+
 	panel {
 		compatible = "edt,etm0700g0edh6";
 		ddc-i2c-bus = <&i2c2>;
@@ -237,6 +311,24 @@ 
 			MX6QDL_PAD_NANDF_CS1__GPIO6_IO14	0x120b0
 		>;
 	};
+
+	pinctrl_keys_pdk2: keys-pdk2-grp {
+		fsl,pins = <
+			MX6QDL_PAD_GPIO_2__GPIO1_IO02		0x120b0 /* TA1 */
+			MX6QDL_PAD_GPIO_4__GPIO1_IO04		0x120b0 /* TA2 */
+			MX6QDL_PAD_GPIO_5__GPIO1_IO05		0x120b0 /* TA3 */
+			MX6QDL_PAD_CSI0_DAT17__GPIO6_IO03	0x120b0 /* TA4 */
+		>;
+	};
+
+	pinctrl_leds_pdk2: leds-pdk2-grp {
+		fsl,pins = <
+			MX6QDL_PAD_DI0_PIN4__GPIO4_IO20		0x120b0 /* led6 */
+			MX6QDL_PAD_KEY_ROW0__GPIO4_IO07		0x120b0 /* led7 */
+			MX6QDL_PAD_KEY_COL1__GPIO4_IO08		0x120b0 /* led8 */
+		>;
+	};
+
 };
 
 &ipu1_di0_disp0 {
diff --git a/arch/arm/boot/dts/imx6q-dhcom-som.dtsi b/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
index c5c060c6b9bf..68ac29d28f4f 100644
--- a/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
+++ b/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
@@ -9,6 +9,7 @@ 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/clock/imx6qdl-clock.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
 	aliases {