dm: core: Add a flag to control sequence numbering

At present we try to use the 'reg' property and device tree aliases to give
devices a sequence number. The 'reg' property is often actually a memory
address, so the sequence numbers thus-obtained are not useful. It would be
better if the devices were just sequentially numbered in that case. In fact
neither I2C nor SPI use this feature, so drop it.

Some devices need us to look up an alias to number them within the uclass.
Add a flag to control this, so it is not done unless it is needed.

Adjust the tests to test this new behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit is contained in:
Simon Glass 2015-01-25 08:27:05 -07:00
parent b367053102
commit 9cc36a2b89
9 changed files with 58 additions and 59 deletions

View file

@ -40,6 +40,9 @@ struct uclass {
struct udevice;
/* Members of this uclass sequence themselves with aliases */
#define DM_UC_FLAG_SEQ_ALIAS (1 << 0)
/**
* struct uclass_driver - Driver for the uclass
*
@ -66,6 +69,7 @@ struct udevice;
* a falback if this member is 0 in the driver.
* @ops: Uclass operations, providing the consistent interface to devices
* within the uclass.
* @flags: Flags for this uclass (DM_UC_...)
*/
struct uclass_driver {
const char *name;
@ -80,6 +84,7 @@ struct uclass_driver {
int per_device_auto_alloc_size;
int per_child_platdata_auto_alloc_size;
const void *ops;
uint32_t flags;
};
/* Declare a new uclass_driver */