diff mbox series

[1/4] udoo_neo: Call gpio_request()

Message ID 20211221123249.455347-1-pbrobinson@gmail.com
State Accepted
Commit 4be9947edf68650db0c68d7c212f98a7cd1dfbdd
Delegated to: Tom Rini
Headers show
Series [1/4] udoo_neo: Call gpio_request() | expand

Commit Message

Peter Robinson Dec. 21, 2021, 12:32 p.m. UTC
Calling gpio_request() prior to its usage is now mandatory.

This fixes the following GPIO errors:
gpio@20a8000: set_dir_flags: error: gpio GPIO4_16 not reserved
gpio@20a8000: set_dir_flags: error: gpio GPIO4_13 not reserved
gpio@20a8000: set_dir_flags: error: gpio GPIO4_0 not reserved
gpio@20a8000: get_value: error: gpio GPIO4_13 not reserved
gpio@20a8000: get_value: error: gpio GPIO4_0 not reserved
gpio@20a0000: set_dir_flags: error: gpio GPIO2_1 not reserved
gpio@20a0000: set_value: error: gpio GPIO2_1 not reserved

Fixes: 191840ae99 ("ARM: imx: udoo_neo: Enable OF_CONTROL and DM gpio/pin control")
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
 board/udoo/neo/neo.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Fabio Estevam Dec. 21, 2021, 1:37 p.m. UTC | #1
On Tue, Dec 21, 2021 at 9:32 AM Peter Robinson <pbrobinson@gmail.com> wrote:
>
> Calling gpio_request() prior to its usage is now mandatory.
>
> This fixes the following GPIO errors:
> gpio@20a8000: set_dir_flags: error: gpio GPIO4_16 not reserved
> gpio@20a8000: set_dir_flags: error: gpio GPIO4_13 not reserved
> gpio@20a8000: set_dir_flags: error: gpio GPIO4_0 not reserved
> gpio@20a8000: get_value: error: gpio GPIO4_13 not reserved
> gpio@20a8000: get_value: error: gpio GPIO4_0 not reserved
> gpio@20a0000: set_dir_flags: error: gpio GPIO2_1 not reserved
> gpio@20a0000: set_value: error: gpio GPIO2_1 not reserved
>
> Fixes: 191840ae99 ("ARM: imx: udoo_neo: Enable OF_CONTROL and DM gpio/pin control")
> Signed-off-by: Peter Robinson <pbrobinson@gmail.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Tom Rini Jan. 7, 2022, 5:02 p.m. UTC | #2
On Tue, Dec 21, 2021 at 12:32:46PM +0000, Peter Robinson wrote:

> Calling gpio_request() prior to its usage is now mandatory.
> 
> This fixes the following GPIO errors:
> gpio@20a8000: set_dir_flags: error: gpio GPIO4_16 not reserved
> gpio@20a8000: set_dir_flags: error: gpio GPIO4_13 not reserved
> gpio@20a8000: set_dir_flags: error: gpio GPIO4_0 not reserved
> gpio@20a8000: get_value: error: gpio GPIO4_13 not reserved
> gpio@20a8000: get_value: error: gpio GPIO4_0 not reserved
> gpio@20a0000: set_dir_flags: error: gpio GPIO2_1 not reserved
> gpio@20a0000: set_value: error: gpio GPIO2_1 not reserved
> 
> Fixes: 191840ae99 ("ARM: imx: udoo_neo: Enable OF_CONTROL and DM gpio/pin control")
> Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/board/udoo/neo/neo.c b/board/udoo/neo/neo.c
index ce005d31cc..61195be744 100644
--- a/board/udoo/neo/neo.c
+++ b/board/udoo/neo/neo.c
@@ -249,6 +249,7 @@  static int setup_fec(void)
 					 ARRAY_SIZE(phy_control_pads));
 
 	/* Reset PHY */
+	gpio_request(IMX_GPIO_NR(2, 1), "enet_rst");
 	gpio_direction_output(IMX_GPIO_NR(2, 1) , 0);
 	udelay(10000);
 	gpio_set_value(IMX_GPIO_NR(2, 1), 1);
@@ -280,6 +281,7 @@  int board_init(void)
 					 ARRAY_SIZE(peri_3v3_pads));
 
 	/* Active high for ncp692 */
+	gpio_request(IMX_GPIO_NR(4, 16), "ncp692");
 	gpio_direction_output(IMX_GPIO_NR(4, 16) , 1);
 
 #ifdef CONFIG_SYS_I2C_MXC
@@ -296,6 +298,8 @@  static int get_board_value(void)
 	imx_iomux_v3_setup_multiple_pads(board_recognition_pads,
 					 ARRAY_SIZE(board_recognition_pads));
 
+	gpio_request(IMX_GPIO_NR(4, 13), "r184");
+	gpio_request(IMX_GPIO_NR(4, 0), "r185");
 	gpio_direction_input(IMX_GPIO_NR(4, 13));
 	gpio_direction_input(IMX_GPIO_NR(4, 0));