[PATCH 4/6] ARM: i.MX6: skov: fix LVDS deep probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With deep probe, barebox will have registered most drivers by the time
it walks the device tree and will then keep probing devices on demand.

This simplifies the common case of devices having dependencies on each
other, but on the other hand expects board code to be deep probe aware.

The Skov board code already takes care to explicitly probe the GPIO
controllers it requires, but it also optionally enables and registers
devices that were initially disabled in the device tree.

It's paramount that devices are only registered _after_ the relevant
device tree parts are rewritten. This was currently not accounted for,
which led to LDB device being probed before its child lvds-channel node
was enabled: We thus ended up with a LDB device, what the driver
couldn't do anything with:

  mode_name: invalid:0 (type: enum)

Fixes: 31d2289da2f3 ("ARM: boards: skov-imx6: start using deep-probe")
Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 arch/arm/boards/skov-imx6/board.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/skov-imx6/board.c b/arch/arm/boards/skov-imx6/board.c
index 7ddc6e937b0b..8f4d7efe4278 100644
--- a/arch/arm/boards/skov-imx6/board.c
+++ b/arch/arm/boards/skov-imx6/board.c
@@ -474,14 +474,15 @@ static void skov_init_ldb(void)
 		return;
 	}
 
-	of_device_enable_and_register(ldb);
-
-	/* ... as well as its channel 0 */
+	/* First enable channel 0, prior to enabling parent */
 	chan = of_find_node_by_name_address(ldb, "lvds-channel@0");
 	if (chan)
 		of_device_enable(chan);
 	else
 		dev_err(skov_priv->dev, "Cannot find \"lvds-channel@0\" node\n");
+
+	/* Now probe will see the expected device tree */
+	of_device_enable_and_register(ldb);
 }
 
 /*
-- 
2.30.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux