diff mbox series

[U-Boot,3/5] pico-imx7d: defconfig Enable DM gpio pinctrl and pinctrl_imx7

Message ID 20190325125158.12457-4-offougajoris@gmail.com
State Superseded
Delegated to: Stefano Babic
Headers show
Series Convert Pico i.MX7 to DM | expand

Commit Message

Joris OFFOUGA March 25, 2019, 12:51 p.m. UTC
This patch is necessary for convert this board to dm driver model

DM GPIO requires gpio_request() to be called explicitly before
doing any gpio operation

Signed-off-by: Joris Offouga <offougajoris@gmail.com>
---
 board/technexion/pico-imx7d/pico-imx7d.c | 4 +++-
 configs/pico-hobbit-imx7d_defconfig      | 3 +++
 configs/pico-imx7d_defconfig             | 3 +++
 configs/pico-pi-imx7d_defconfig          | 3 +++
 4 files changed, 12 insertions(+), 1 deletion(-)

Comments

Fabio Estevam March 25, 2019, 1:42 p.m. UTC | #1
On Mon, Mar 25, 2019 at 9:52 AM Joris Offouga <offougajoris@gmail.com> wrote:
>
> This patch is necessary for convert this board to dm driver model
>
> DM GPIO requires gpio_request() to be called explicitly before
> doing any gpio operation
>
> Signed-off-by: Joris Offouga <offougajoris@gmail.com>

Tested-by: Fabio Estevam <festevam@gmail.com>
diff mbox series

Patch

diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c
index 767d13dfe5..3b9be45587 100644
--- a/board/technexion/pico-imx7d/pico-imx7d.c
+++ b/board/technexion/pico-imx7d/pico-imx7d.c
@@ -165,7 +165,7 @@  static iomux_v3_cfg_t const fec1_pads[] = {
 static void setup_iomux_fec(void)
 {
 	imx_iomux_v3_setup_multiple_pads(fec1_pads, ARRAY_SIZE(fec1_pads));
-
+	gpio_request(FEC1_RST_GPIO, "phy_rst");
 	gpio_direction_output(FEC1_RST_GPIO, 0);
 	udelay(500);
 	gpio_set_value(FEC1_RST_GPIO, 1);
@@ -291,6 +291,8 @@  static iomux_v3_cfg_t const lcd_pads[] = {
 void setup_lcd(void)
 {
 	imx_iomux_v3_setup_multiple_pads(lcd_pads, ARRAY_SIZE(lcd_pads));
+	gpio_request(IMX_GPIO_NR(1, 11), "lcd_brightness");
+	gpio_request(IMX_GPIO_NR(1, 6), "lcd_enable");
 	/* Set Brightness to high */
 	gpio_direction_output(IMX_GPIO_NR(1, 11) , 1);
 	/* Set LCD enable to high */
diff --git a/configs/pico-hobbit-imx7d_defconfig b/configs/pico-hobbit-imx7d_defconfig
index 75eab28aba..a830aa85a2 100644
--- a/configs/pico-hobbit-imx7d_defconfig
+++ b/configs/pico-hobbit-imx7d_defconfig
@@ -27,6 +27,9 @@  CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_CMD_BOOTMENU=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_XIMG is not set
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX7=y
+CONFIG_DM_GPIO=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_DFU=y
diff --git a/configs/pico-imx7d_defconfig b/configs/pico-imx7d_defconfig
index 13704941cf..54d7da8768 100644
--- a/configs/pico-imx7d_defconfig
+++ b/configs/pico-imx7d_defconfig
@@ -27,6 +27,9 @@  CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_CMD_BOOTMENU=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_XIMG is not set
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX7=y
+CONFIG_DM_GPIO=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_DFU=y
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig
index 05d5fe5175..662492aae1 100644
--- a/configs/pico-pi-imx7d_defconfig
+++ b/configs/pico-pi-imx7d_defconfig
@@ -27,6 +27,9 @@  CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_CMD_BOOTMENU=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_XIMG is not set
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX7=y
+CONFIG_DM_GPIO=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_DFU=y