From 3542ff29e4542b8cb0ac3ae861247e9bd487f22f Mon Sep 17 00:00:00 2001 From: Jean-Jacques Hiblot Date: Fri, 7 Dec 2018 14:50:39 +0100 Subject: dm: device: Allow using uclass_find_device_by_seq() without OF_CONTROL If OF_CONTROL is not enabled and DM_SEQ_ALIAS is enabled, we must assign an alias (requested sequence number) to devices that belongs to a class with the DM_UC_FLAG_SEQ_ALIAS flag. Otherwise uclass_find_device_by_seq() cannot be used to get/probe a device. In particular i2c_get_chip_for_busnum() cannot be used. Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher --- include/dm/uclass-internal.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/dm') diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h index 8a4839ee88..6977995246 100644 --- a/include/dm/uclass-internal.h +++ b/include/dm/uclass-internal.h @@ -11,6 +11,19 @@ #include +/** + * uclass_find_next_free_req_seq() - Get the next free req_seq number + * + * This returns the next free req_seq number. This is useful only if + * OF_CONTROL is not used. The next free req_seq number is simply the + * maximum req_seq of the uclass + 1. + * This allows assiging req_seq number in the binding order. + * + * @id: Id number of the uclass + * @return The next free req_seq number + */ +int uclass_find_next_free_req_seq(enum uclass_id id); + /** * uclass_get_device_tail() - handle the end of a get_device call * -- cgit