mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 11/11] ARM: rdu2: Replace board code with gpio-hog nodes
Date: Fri, 26 Oct 2018 18:31:57 -0700	[thread overview]
Message-ID: <20181027013157.23135-12-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20181027013157.23135-1-andrew.smirnov@gmail.com>

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-imx6q-rdu2/board.c | 38 --------------------------
 arch/arm/dts/imx6qdl-zii-rdu2.dtsi     | 36 ++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
index c99f993f0..e174032c9 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/board.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
@@ -97,44 +97,6 @@ static int rdu2_reset_audio_touchscreen_nfc(void)
  */
 late_initcall(rdu2_reset_audio_touchscreen_nfc);
 
-static const struct gpio rdu2_front_panel_usb_gpios[] = {
-	{
-		.gpio = IMX_GPIO_NR(3, 19),
-		.flags = GPIOF_OUT_INIT_LOW,
-		.label = "usb-emulation",
-	},
-	{
-		.gpio = IMX_GPIO_NR(3, 20),
-		.flags = GPIOF_OUT_INIT_HIGH,
-		.label = "usb-mode1",
-	},
-	{
-		.gpio = IMX_GPIO_NR(3, 23),
-		.flags = GPIOF_OUT_INIT_HIGH,
-		.label = "usb-mode2",
-	},
-};
-
-static int rdu2_enable_front_panel_usb(void)
-{
-	int ret;
-
-	if (!of_machine_is_compatible("zii,imx6q-zii-rdu2") &&
-	    !of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
-		return 0;
-
-	ret = gpio_request_array(rdu2_front_panel_usb_gpios,
-				 ARRAY_SIZE(rdu2_front_panel_usb_gpios));
-	if (ret) {
-		pr_err("Failed to request RDU2 front panel USB gpios: %s\n",
-		       strerror(-ret));
-
-	}
-
-	return ret;
-}
-late_initcall(rdu2_enable_front_panel_usb);
-
 static int rdu2_devices_init(void)
 {
 	if (!of_machine_is_compatible("zii,imx6q-zii-rdu2") &&
diff --git a/arch/arm/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/dts/imx6qdl-zii-rdu2.dtsi
index 3915c34df..a3f6dbd15 100644
--- a/arch/arm/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/dts/imx6qdl-zii-rdu2.dtsi
@@ -130,3 +130,39 @@
 		};
 	};
 };
+
+&gpio3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_gpio3_hog>;
+
+	usb-emulation {
+		gpio-hog;
+		gpios = <19 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "usb-emulation";
+	};
+
+	usb-mode1 {
+		gpio-hog;
+		gpios = <20 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "usb-mode1";
+	};
+
+	usb-mode2 {
+		gpio-hog;
+		gpios = <23 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "usb-mode2";
+	};
+};
+
+&iomuxc {
+	pinctrl_gpio3_hog: gpio3hoggrp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D19__GPIO3_IO19		0x40000038
+			MX6QDL_PAD_EIM_D20__GPIO3_IO20		0x40000038
+			MX6QDL_PAD_EIM_D23__GPIO3_IO23		0x40000038
+		>;
+	};
+};
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-10-27  1:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-27  1:31 [PATCH 00/11] Allow GPIOs to be referenced by label Andrey Smirnov
2018-10-27  1:31 ` [PATCH 01/11] gpio: VF610: Propagate error code of gpiochip_add() up Andrey Smirnov
2018-10-27  1:31 ` [PATCH 02/11] VF610: Initialize pinctrl driver before gpio Andrey Smirnov
2018-10-27  1:31 ` [PATCH 03/11] linux/ctype.h: Port _tolower() Andrey Smirnov
2018-10-27  1:31 ` [PATCH 04/11] lib: Port kstrtox.c from Linux kernel Andrey Smirnov
2018-10-27  1:31 ` [PATCH 05/11] commands: gpio: Move argument parsing into a shared function Andrey Smirnov
2018-10-27  1:31 ` [PATCH 06/11] commands: gpio: Use kstrtoint() instead of simple_strtoul() Andrey Smirnov
2018-10-27  1:31 ` [PATCH 07/11] gpiolib: Introduce gpio_find_by_label() Andrey Smirnov
2018-10-27  1:31 ` [PATCH 08/11] commands: gpio: Allow GPIOs to be specified by label Andrey Smirnov
2018-10-27  1:31 ` [PATCH 09/11] VF610: zii-vf610-dev: Drop switch reset GPIO configuration Andrey Smirnov
2018-10-27  1:31 ` [PATCH 10/11] VF610: zii-vf610-dev: Replace board code with gpio-hog nodes Andrey Smirnov
2018-10-29 11:13   ` Sascha Hauer
2018-10-29 17:14     ` Andrey Smirnov
2018-10-27  1:31 ` Andrey Smirnov [this message]
2018-11-05 16:25   ` [PATCH 11/11] ARM: rdu2: " Andrey Smirnov
2018-11-06  8:25     ` Sascha Hauer
2018-10-27  8:42 ` [PATCH 00/11] Allow GPIOs to be referenced by label Sam Ravnborg
2018-10-29 11:17   ` Sascha Hauer
2018-10-29 11:14 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181027013157.23135-12-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox