sconfig: Allow setting device status in device tree
For devices supporting both Linux and Windows, we may find some ACPI devices that only need drivers in Linux and should not even be shown in Windows Device Manager UI. The new 'hidden' keyword in device tree 'device' statement allows devices sharing same driver to call acpi_gen_writeSTA with different values. BUG=b:72200466 BRANCH=eve TEST=Builds and boots properly on device eve Change-Id: Iae881a294b122d3a581b456285d2992ab637fb8e Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://review.coreboot.org/28566 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
committed by
Patrick Georgi
parent
c1dc7932b5
commit
936dbe1d06
@ -480,7 +480,7 @@ static void set_new_child(struct bus *parent, struct device *child)
|
||||
struct device *new_device(struct bus *parent,
|
||||
struct chip_instance *chip_instance,
|
||||
const int bustype, const char *devnum,
|
||||
int enabled)
|
||||
int status)
|
||||
{
|
||||
char *tmp;
|
||||
int path_a;
|
||||
@ -511,7 +511,8 @@ struct device *new_device(struct bus *parent,
|
||||
sprintf(name, "_dev%d", new_d->id);
|
||||
new_d->name = name;
|
||||
|
||||
new_d->enabled = enabled;
|
||||
new_d->enabled = status & 0x01;
|
||||
new_d->hidden = (status >> 1) & 0x01;
|
||||
new_d->chip_instance = chip_instance;
|
||||
chip_instance->ref_count++;
|
||||
|
||||
@ -787,6 +788,7 @@ static void pass1(FILE *fil, struct device *ptr, struct device *next)
|
||||
fprintf(fil, ptr->path, ptr->path_a, ptr->path_b);
|
||||
fprintf(fil, "},\n");
|
||||
fprintf(fil, "\t.enabled = %d,\n", ptr->enabled);
|
||||
fprintf(fil, "\t.hidden = %d,\n", ptr->hidden);
|
||||
fprintf(fil, "\t.on_mainboard = 1,\n");
|
||||
if (ptr->subsystem_vendor > 0)
|
||||
fprintf(fil, "\t.subsystem_vendor = 0x%04x,\n",
|
||||
|
Reference in New Issue
Block a user