UPSTREAM: device: Add scan_generic_bus support
scan_smbus routine does not perform any smbus specific operation. Thus,
rename the routine to scan_generic_bus so that it can be used by other
buses like SPI. Add a wrapper scan_smbus to allow other users of smbus
scan to continue working as before.
BUG=chrome-os-partner:59832
BRANCH=None
TEST=Compiles successfully
Change-Id: Id2b6342d96915e47c265c7984f651680632a3903
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Original-Commit-Id: 4e08479688
Original-Change-Id: I8ca1a2b7f2906d186ec39e9223ce18b8a1f27196
Original-Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/18363
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://chromium-review.googlesource.com/444809
This commit is contained in:
parent
c135ff2abc
commit
f5ee28d3a6
2 changed files with 10 additions and 4 deletions
|
|
@ -72,17 +72,17 @@ void scan_lpc_bus(device_t bus)
|
|||
printk(BIOS_SPEW, "%s for %s done\n", __func__, dev_path(bus));
|
||||
}
|
||||
|
||||
void scan_smbus(device_t bus)
|
||||
void scan_generic_bus(device_t bus)
|
||||
{
|
||||
device_t child;
|
||||
struct bus *link;
|
||||
static int smbus_max = 0;
|
||||
static int bus_max = 0;
|
||||
|
||||
printk(BIOS_SPEW, "%s for %s\n", __func__, dev_path(bus));
|
||||
|
||||
for (link = bus->link_list; link; link = link->next) {
|
||||
|
||||
link->secondary = ++smbus_max;
|
||||
link->secondary = ++bus_max;
|
||||
|
||||
for (child = link->children; child; child = child->sibling) {
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ void scan_smbus(device_t bus)
|
|||
if (child->ops && child->ops->enable)
|
||||
child->ops->enable(child);
|
||||
|
||||
printk(BIOS_DEBUG, "smbus: %s[%d]->", dev_path(child->bus->dev),
|
||||
printk(BIOS_DEBUG, "bus: %s[%d]->", dev_path(child->bus->dev),
|
||||
child->bus->link_num);
|
||||
|
||||
printk(BIOS_DEBUG, "%s %s\n", dev_path(child),
|
||||
|
|
@ -103,6 +103,11 @@ void scan_smbus(device_t bus)
|
|||
printk(BIOS_SPEW, "%s for %s done\n", __func__, dev_path(bus));
|
||||
}
|
||||
|
||||
void scan_smbus(device_t bus)
|
||||
{
|
||||
scan_generic_bus(bus);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scan root bus for generic systems.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ void mmconf_resource_init(struct resource *res, resource_t base, int buses);
|
|||
void mmconf_resource(struct device *dev, unsigned long index);
|
||||
|
||||
void scan_smbus(device_t bus);
|
||||
void scan_generic_bus(device_t bus);
|
||||
void scan_static_bus(device_t bus);
|
||||
void scan_lpc_bus(device_t bus);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue