diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2013-05-23 14:17:05 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2013-11-25 23:38:21 +0100 |
commit | 21a78706addd15fcc682f556566c303a463fcda1 (patch) | |
tree | 837dfebece007b022a03c9da1fddd0ddab1a0540 /src/mainboard/google/link | |
parent | 032be82a11a9cee6cc45df7a5ea94778ea4280d7 (diff) |
smbios: Add generic type41 write function
Mainboards were defining their own SMBIOS type41
write function. Instead pull this into the generic
SMBIOS code and change the existing mainboards to
make use of it.
Change-Id: I3c8a95ca51fe2a3118dc8d1154011ccfed5fbcbc
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56619
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/4187
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/mainboard/google/link')
-rw-r--r-- | src/mainboard/google/link/mainboard.c | 65 |
1 files changed, 26 insertions, 39 deletions
diff --git a/src/mainboard/google/link/mainboard.c b/src/mainboard/google/link/mainboard.c index 2731df0204..08b1c02a96 100644 --- a/src/mainboard/google/link/mainboard.c +++ b/src/mainboard/google/link/mainboard.c @@ -180,50 +180,37 @@ static void mainboard_init(device_t dev) } } -static int link_smbios_type41(int *handle, unsigned long *current, - const char *name, u8 irq, u8 addr) -{ - struct smbios_type41 *t = (struct smbios_type41 *)*current; - int len = sizeof(struct smbios_type41); - - memset(t, 0, sizeof(struct smbios_type41)); - t->type = SMBIOS_ONBOARD_DEVICES_EXTENDED_INFORMATION; - t->handle = *handle; - t->length = len - 2; - t->reference_designation = smbios_add_string(t->eos, name); - t->device_type = SMBIOS_DEVICE_TYPE_OTHER; - t->device_status = 1; - t->device_type_instance = irq; - t->segment_group_number = 0; - t->bus_number = addr; - t->function_number = 0; - t->device_number = 0; - - len = t->length + smbios_string_table_len(t->eos); - *current += len; - *handle += 1; - return len; -} - static int link_onboard_smbios_data(device_t dev, int *handle, unsigned long *current) { int len = 0; - len += link_smbios_type41(handle, current, - LINK_LIGHTSENSOR_NAME, - LINK_LIGHTSENSOR_IRQ, - LINK_LIGHTSENSOR_I2C_ADDR); - - len += link_smbios_type41(handle, current, - LINK_TRACKPAD_NAME, - LINK_TRACKPAD_IRQ, - LINK_TRACKPAD_I2C_ADDR); - - len += link_smbios_type41(handle, current, - LINK_TOUCHSCREEN_NAME, - LINK_TOUCHSCREEN_IRQ, - LINK_TOUCHSCREEN_I2C_ADDR); + len += smbios_write_type41( + current, handle, + LINK_LIGHTSENSOR_NAME, /* name */ + LINK_LIGHTSENSOR_IRQ, /* instance */ + 0, /* segment */ + LINK_LIGHTSENSOR_I2C_ADDR, /* bus */ + 0, /* device */ + 0); /* function */ + + len += smbios_write_type41( + current, handle, + LINK_TRACKPAD_NAME, /* name */ + LINK_TRACKPAD_IRQ, /* instance */ + 0, /* segment */ + LINK_TRACKPAD_I2C_ADDR, /* bus */ + 0, /* device */ + 0); /* function */ + + len += smbios_write_type41( + current, handle, + LINK_TOUCHSCREEN_NAME, /* name */ + LINK_TOUCHSCREEN_IRQ, /* instance */ + 0, /* segment */ + LINK_TOUCHSCREEN_I2C_ADDR, /* bus */ + 0, /* device */ + 0); /* function */ return len; } |