fexc: add port:power support

This commit is contained in:
Alejandro Mery 2012-07-23 17:06:41 +02:00
parent 815691218a
commit dbc4515eed
2 changed files with 11 additions and 3 deletions

View File

@ -253,8 +253,10 @@ static int decompile_section(void *bin, size_t UNUSED(bin_size),
if (words != 6) {
pr_err("%s: %s.%s: invalid length %d (assuming %d)\n",
filename, section->name, entry->name, words, 6);
} else if (gpio->port == 0xffff) {
; /* port:power */
} else if (gpio->port < 1 || gpio->port > 10) {
pr_err("%s: %s.%s: unknown GPIO port type %d\n",
pr_err("%s: %s.%s: unknown GPIO port type %u\n",
filename, section->name, entry->name, gpio->port);
goto failure;
}

View File

@ -125,8 +125,14 @@ int script_generate_fex(FILE *out, const char *UNUSED(filename),
struct script_gpio_entry *gpio;
gpio = container_of(entry, struct script_gpio_entry, entry);
port += gpio->port;
fprintf(out, "%s = port:P%c%02d", entry->name, port, gpio->port_num);
if (gpio->port == 0xffff) {
fprintf(out, "%s = port:power%u", entry->name,
gpio->port_num);
} else {
port += gpio->port;
fprintf(out, "%s = port:P%c%02u", entry->name,
port, gpio->port_num);
}
for (const int *p = gpio->data, *pe = p+4; p != pe; p++) {
if (*p == -1)
fputs("<default>", out);