From dbc4515eedc036a36a3efaecae376cbaecf43454 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Mon, 23 Jul 2012 17:06:41 +0200 Subject: [PATCH] fexc: add port:power support --- script_bin.c | 4 +++- script_fex.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/script_bin.c b/script_bin.c index 30d4616..752f519 100644 --- a/script_bin.c +++ b/script_bin.c @@ -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; } diff --git a/script_fex.c b/script_fex.c index 8aff465..edc96bb 100644 --- a/script_fex.c +++ b/script_fex.c @@ -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("", out);